Revision: 16061
http://sourceforge.net/p/skim-app/code/16061
Author: hofman
Date: 2026-03-14 16:57:44 +0000 (Sat, 14 Mar 2026)
Log Message:
-----------
reimplement hidden pref to collapse side panes in full screen
Modified Paths:
--------------
trunk/SKMainWindowController.m
trunk/SKMainWindowController_FullScreen.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2026-03-11 22:31:13 UTC (rev 16060)
+++ trunk/SKMainWindowController.m 2026-03-14 16:57:44 UTC (rev 16061)
@@ -178,6 +178,8 @@
#define SKTitleAndToolbarStyleKey @"SKTitleAndToolbarStyle"
+#define SKCollapseSidePanesInFullScreenKey @"SKCollapseSidePanesInFullScreen"
+
#pragma mark -
static SKDestination destinationFromSetup(NSDictionary *setup);
@@ -550,10 +552,13 @@
[savedNormalWindow setFrame:NSRectFromString(rectString)
display:NO];
}
- NSNumber *leftWidthNumber = [setup objectForKey:LEFTSIDEPANEWIDTH_KEY];
- NSNumber *rightWidthNumber = [setup
objectForKey:RIGHTSIDEPANEWIDTH_KEY];
- if (leftWidthNumber && rightWidthNumber)
- [self applyLeftSideWidth:[leftWidthNumber doubleValue]
rightSideWidth:[rightWidthNumber doubleValue]];
+ BOOL applySidePaneWidths = [self interactionMode] != SKFullScreenMode
|| [[NSUserDefaults standardUserDefaults]
boolForKey:SKCollapseSidePanesInFullScreenKey] == NO;
+ if (applySidePaneWidths) {
+ NSNumber *leftWidthNumber = [setup
objectForKey:LEFTSIDEPANEWIDTH_KEY];
+ NSNumber *rightWidthNumber = [setup
objectForKey:RIGHTSIDEPANEWIDTH_KEY];
+ if (leftWidthNumber && rightWidthNumber)
+ [self applyLeftSideWidth:[leftWidthNumber doubleValue]
rightSideWidth:[rightWidthNumber doubleValue]];
+ }
if ([[pdfView document] isLocked]) {
NSArray *snapshotSetups = [savedNormalSetup
objectForKey:SNAPSHOTS_KEY];
@@ -563,7 +568,9 @@
} else {
if ([self interactionMode] != SKNormalMode) {
[savedNormalSetup addEntriesFromDictionary:setup];
- [savedNormalSetup
removeObjectsForKeys:@[LEFTSIDEPANEWIDTH_KEY, RIGHTSIDEPANEWIDTH_KEY,
CROPBOXES_KEY, SNAPSHOTS_KEY, PAGEINDEX_KEY, SCROLLPOINT_KEY]];
+ [savedNormalSetup removeObjectsForKeys:@[CROPBOXES_KEY,
SNAPSHOTS_KEY, PAGEINDEX_KEY, SCROLLPOINT_KEY]];
+ if (applySidePaneWidths)
+ [savedNormalSetup
removeObjectsForKeys:@[LEFTSIDEPANEWIDTH_KEY, RIGHTSIDEPANEWIDTH_KEY]];
}
if ([self interactionMode] == SKPresentationMode) {
NSMutableDictionary *mutableSetup = [setup mutableCopy];
Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m 2026-03-11 22:31:13 UTC (rev
16060)
+++ trunk/SKMainWindowController_FullScreen.m 2026-03-14 16:57:44 UTC (rev
16061)
@@ -73,8 +73,11 @@
#define MAINWINDOWFRAME_KEY @"windowFrame"
#define TABGROUP_KEY @"tabGroup"
#define TABINDEX_KEY @"tabIndex"
+#define LEFTSIDEPANEWIDTH_KEY @"leftSidePaneWidth"
+#define RIGHTSIDEPANEWIDTH_KEY @"rightSidePaneWidth"
#define SKAutoHideToolbarInFullScreenKey @"SKAutoHideToolbarInFullScreen"
+#define SKCollapseSidePanesInFullScreenKey @"SKCollapseSidePanesInFullScreen"
#define SKResizablePresentationKey @"SKResizablePresentation"
#define AppleMenuBarVisibleInFullscreenKey @"AppleMenuBarVisibleInFullscreen"
@@ -83,6 +86,10 @@
static CGFloat fullScreenToolbarOffset = 0.0;
+@interface SKMainWindowController (SKFullScreenPrivate)
+- (void)applyLeftSideWidth:(CGFloat)leftSideWidth
rightSideWidth:(CGFloat)rightSideWidth;
+@end
+
@implementation SKMainWindowController (FullScreen)
#pragma mark Side Windows
@@ -554,6 +561,11 @@
NSColor *backgroundColor = [PDFView defaultFullScreenBackgroundColor];
[pdfView setBackgroundColor:backgroundColor];
[secondaryPdfView setBackgroundColor:backgroundColor];
+ if ([[NSUserDefaults standardUserDefaults]
boolForKey:SKCollapseSidePanesInFullScreenKey]) {
+ [savedNormalSetup setObject:[NSNumber numberWithDouble:[self
leftSideWidth]] forKey:LEFTSIDEPANEWIDTH_KEY];
+ [savedNormalSetup setObject:[NSNumber numberWithDouble:[self
rightSideWidth]] forKey:RIGHTSIDEPANEWIDTH_KEY];
+ [self applyLeftSideWidth:0.0 rightSideWidth:0.0];
+ }
if ([[pdfView document] isLocked] == NO) {
NSDictionary *fullScreenSetup = [[NSUserDefaults
standardUserDefaults]
dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey];
if ([fullScreenSetup count])
@@ -568,6 +580,12 @@
NSColor *backgroundColor = [PDFView defaultBackgroundColor];
[pdfView setBackgroundColor:backgroundColor];
[secondaryPdfView setBackgroundColor:backgroundColor];
+ if ([[NSUserDefaults standardUserDefaults]
boolForKey:SKCollapseSidePanesInFullScreenKey]) {
+ NSNumber *leftWidthNumber = [savedNormalSetup
objectForKey:LEFTSIDEPANEWIDTH_KEY];
+ NSNumber *rightWidthNumber = [savedNormalSetup
objectForKey:RIGHTSIDEPANEWIDTH_KEY];
+ if (leftWidthNumber && rightWidthNumber)
+ [self applyLeftSideWidth:[leftWidthNumber doubleValue]
rightSideWidth:[rightWidthNumber doubleValue]];
+ }
if ([[[NSUserDefaults standardUserDefaults]
dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey] count])
[pdfView setDisplaySettingsAndRewind:savedNormalSetup];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit