Revision: 16067
          http://sourceforge.net/p/skim-app/code/16067
Author:   hofman
Date:     2026-03-15 22:06:27 +0000 (Sun, 15 Mar 2026)
Log Message:
-----------
setters for side pane widths instead of method to apply both

Modified Paths:
--------------
    trunk/SKMainWindowController.h
    trunk/SKMainWindowController.m
    trunk/SKMainWindowController_FullScreen.m

Modified: trunk/SKMainWindowController.h
===================================================================
--- trunk/SKMainWindowController.h      2026-03-15 21:57:59 UTC (rev 16066)
+++ trunk/SKMainWindowController.h      2026-03-15 22:06:27 UTC (rev 16067)
@@ -272,7 +272,7 @@
 
 @property (nonatomic, readonly) BOOL displaysFindPane;
 @property (nonatomic, readonly) BOOL leftSidePaneIsOpen, rightSidePaneIsOpen;
-@property (nonatomic, readonly) NSNumber *leftSideWidth, *rightSideWidth;
+@property (nonatomic, strong) NSNumber *leftSideWidth, *rightSideWidth;
 
 @property (nonatomic, nullable, readonly) NSMenu *notesMenu;
 

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2026-03-15 21:57:59 UTC (rev 16066)
+++ trunk/SKMainWindowController.m      2026-03-15 22:06:27 UTC (rev 16067)
@@ -190,8 +190,6 @@
 
 - (void)cleanup;
 
-- (void)applyLeftSideWidth:(NSNumber *)leftSideWidth rightSideWidth:(NSNumber 
*)rightSideWidth;
-
 - (void)updateTableFont;
 
 - (void)updatePageLabel;
@@ -412,8 +410,10 @@
     
     NSNumber *leftWidthNumber = [savedNormalSetup 
objectForKey:LEFTSIDEPANEWIDTH_KEY] ?: [sud 
objectForKey:SKLeftSidePaneWidthKey];
     NSNumber *rightWidthNumber = [savedNormalSetup 
objectForKey:RIGHTSIDEPANEWIDTH_KEY] ?: [sud 
objectForKey:SKRightSidePaneWidthKey];
-    if (leftWidthNumber && rightWidthNumber)
-        [self applyLeftSideWidth:leftWidthNumber 
rightSideWidth:rightWidthNumber];
+    if (leftWidthNumber && rightWidthNumber) {
+        [self setLeftSideWidth:leftWidthNumber];
+        [self setRightSideWidth:rightWidthNumber];
+    }
     
     // this needs to be done before loading the PDFDocument
     [self resetThumbnailSizeIfNeeded];
@@ -532,11 +532,6 @@
     mwcFlags.settingUpWindow = 0;
 }
 
-- (void)applyLeftSideWidth:(NSNumber *)leftSideWidth rightSideWidth:(NSNumber 
*)rightSideWidth {
-    [splitView setPosition:[leftSideWidth doubleValue] ofDividerAtIndex:0];
-    [splitView setPosition:[splitView maxPossiblePositionOfDividerAtIndex:1] - 
[splitView dividerThickness] - [rightSideWidth doubleValue] ofDividerAtIndex:1];
-}
-
 - (void)applySetup:(NSDictionary *)setup{
     if ([self isWindowLoaded] == NO) {
         [savedNormalSetup setDictionary:setup];
@@ -556,8 +551,10 @@
         if (applySidePaneWidths) {
             NSNumber *leftWidthNumber = [setup 
objectForKey:LEFTSIDEPANEWIDTH_KEY];
             NSNumber *rightWidthNumber = [setup 
objectForKey:RIGHTSIDEPANEWIDTH_KEY];
-            if (leftWidthNumber && rightWidthNumber)
-                [self applyLeftSideWidth:leftWidthNumber 
rightSideWidth:rightWidthNumber];
+            if (leftWidthNumber && rightWidthNumber) {
+                [self setLeftSideWidth:leftWidthNumber];
+                [self setRightSideWidth:rightWidthNumber];
+            }
         }
         
         if ([[pdfView document] isLocked]) {
@@ -1343,10 +1340,18 @@
     return [self leftSidePaneIsOpen] ? [NSNumber 
numberWithDouble:NSWidth([leftSideContentView frame])] : @0.0;
 }
 
+- (void)setLeftSideWidth:(NSNumber *)leftSideWidth {
+    [splitView setPosition:[leftSideWidth doubleValue] ofDividerAtIndex:0];
+}
+
 - (NSNumber *)rightSideWidth {
     return [self rightSidePaneIsOpen] ? [NSNumber 
numberWithDouble:NSWidth([rightSideContentView frame])] : @0.0;
 }
 
+- (void)setRightSideWidth:(NSNumber *)rightSideWidth {
+    [splitView setPosition:[splitView maxPossiblePositionOfDividerAtIndex:1] - 
[splitView dividerThickness] - [rightSideWidth doubleValue] ofDividerAtIndex:1];
+}
+
 - (BOOL)hasNotes {
     if ([notes count] > 0 || [placeholderWidgetProperties count] > 0)
         return YES;

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2026-03-15 21:57:59 UTC (rev 
16066)
+++ trunk/SKMainWindowController_FullScreen.m   2026-03-15 22:06:27 UTC (rev 
16067)
@@ -86,10 +86,6 @@
 
 static CGFloat fullScreenToolbarOffset = 0.0;
 
-@interface SKMainWindowController (SKFullScreenPrivate)
-- (void)applyLeftSideWidth:(NSNumber *)leftSideWidth rightSideWidth:(NSNumber 
*)rightSideWidth;
-@end
-
 @implementation SKMainWindowController (FullScreen)
 
 #pragma mark Side Windows
@@ -564,7 +560,8 @@
         if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKCollapseSidePanesInFullScreenKey]) {
             [savedNormalSetup setObject:[self leftSideWidth] 
forKey:LEFTSIDEPANEWIDTH_KEY];
             [savedNormalSetup setObject:[self rightSideWidth] 
forKey:RIGHTSIDEPANEWIDTH_KEY];
-            [self applyLeftSideWidth:@0.0 rightSideWidth:@0.0];
+            [self setLeftSideWidth:@0.0];
+            [self setRightSideWidth:@0.0];
         }
         if ([[pdfView document] isLocked] == NO) {
             NSDictionary *fullScreenSetup = [[NSUserDefaults 
standardUserDefaults] 
dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey];
@@ -583,8 +580,10 @@
         if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKCollapseSidePanesInFullScreenKey]) {
             NSNumber *leftWidthNumber = [savedNormalSetup 
objectForKey:LEFTSIDEPANEWIDTH_KEY];
             NSNumber *rightWidthNumber = [savedNormalSetup 
objectForKey:RIGHTSIDEPANEWIDTH_KEY];
-            if (leftWidthNumber && rightWidthNumber)
-                [self applyLeftSideWidth:leftWidthNumber 
rightSideWidth:rightWidthNumber];
+            if (leftWidthNumber && rightWidthNumber) {
+                [self setLeftSideWidth:leftWidthNumber];
+                [self setRightSideWidth:rightWidthNumber];
+            }
         }
         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

Reply via email to