Revision: 15358 http://sourceforge.net/p/skim-app/code/15358 Author: hofman Date: 2025-06-03 16:28:36 +0000 (Tue, 03 Jun 2025) Log Message: ----------- better apply of setup in varous situations
Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-06-03 14:36:04 UTC (rev 15357) +++ trunk/SKMainWindowController.m 2025-06-03 16:28:36 UTC (rev 15358) @@ -553,14 +553,14 @@ [savedNormalSetup setDictionary:setup]; } else { - if ([self interactionMode] != SKFullScreenMode) { - NSString *rectString = [setup objectForKey:MAINWINDOWFRAME_KEY]; - if (rectString) { - if ([self interactionMode] == SKPresentationMode) - [savedNormalWindow setFrame:NSRectFromString(rectString) display:NO]; - else - [[self window] setFrame:NSRectFromString(rectString) display:YES]; - } + NSString *rectString = [setup objectForKey:MAINWINDOWFRAME_KEY]; + if (rectString) { + if ([self interactionMode] == SKNormalMode) + [[self window] setFrame:NSRectFromString(rectString) display:YES]; + else if ([self interactionMode] == SKFullScreenMode) + [savedNormalSetup setObject:rectString forKey:MAINWINDOWFRAME_KEY]; + else + [savedNormalWindow setFrame:NSRectFromString(rectString) display:NO]; } NSNumber *leftWidth = [setup objectForKey:LEFTSIDEPANEWIDTH_KEY]; @@ -568,24 +568,30 @@ if (leftWidth && rightWidth) [self applyLeftSideWidth:[leftWidth doubleValue] rightSideWidth:[rightWidth doubleValue]]; - [self applyChangedCropBoxes:[setup objectForKey:CROPBOXES_KEY] inDocument:[self pdfDocument]]; - - NSArray *snapshotSetups = [setup objectForKey:SNAPSHOTS_KEY]; - if ([snapshotSetups count]) - [self showSnapshotsWithSetups:snapshotSetups]; - - if ([self interactionMode] == SKNormalMode) - [pdfView setDisplaySettings:setup]; - else + if ([[pdfView document] isLocked]) { [savedNormalSetup addEntriesFromDictionary:setup]; - - NSNumber *pageIndexNumber = [setup objectForKey:PAGEINDEX_KEY]; - SKDestination dest = {[pageIndexNumber unsignedIntegerValue], SKUnspecifiedPoint}; - if (pageIndexNumber && dest.pageIndex != NSNotFound && dest.pageIndex != [[pdfView currentPage] pageIndex]) { - NSString *pointString = [setup objectForKey:SCROLLPOINT_KEY]; - if (pointString) - dest.point = NSPointFromString(pointString); - [pdfView goToCurrentDestination:dest]; + } else { + if ([self interactionMode] != SKNormalMode) { + [savedNormalSetup addEntriesFromDictionary:setup]; + [savedNormalSetup removeObjectsForKeys:@[LEFTSIDEPANEWIDTH_KEY, RIGHTSIDEPANEWIDTH_KEY, CROPBOXES_KEY, SNAPSHOTS_KEY, PAGEINDEX_KEY, SCROLLPOINT_KEY]]; + } + if ([self interactionMode] != SKFullScreenMode || [[[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey] count] == 0) + [pdfView setDisplaySettings:setup]; + + [self applyChangedCropBoxes:[setup objectForKey:CROPBOXES_KEY] inDocument:[self pdfDocument]]; + + NSArray *snapshotSetups = [setup objectForKey:SNAPSHOTS_KEY]; + if ([snapshotSetups count]) + [self showSnapshotsWithSetups:snapshotSetups]; + + NSNumber *pageIndexNumber = [setup objectForKey:PAGEINDEX_KEY]; + SKDestination dest = {[pageIndexNumber unsignedIntegerValue], SKUnspecifiedPoint}; + if (pageIndexNumber && dest.pageIndex != NSNotFound && dest.pageIndex != [[pdfView currentPage] pageIndex]) { + NSString *pointString = [setup objectForKey:SCROLLPOINT_KEY]; + if (pointString) + dest.point = NSPointFromString(pointString); + [pdfView goToCurrentDestination:dest]; + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit