Revision: 15555
          http://sourceforge.net/p/skim-app/code/15555
Author:   hofman
Date:     2025-06-28 09:01:47 +0000 (Sat, 28 Jun 2025)
Log Message:
-----------
set side pane widths and get them from setup in singlle method

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2025-06-28 08:55:10 UTC (rev 15554)
+++ trunk/SKMainWindowController.m      2025-06-28 09:01:47 UTC (rev 15555)
@@ -189,7 +189,7 @@
 - (SKDestination)destinationFromSetup:(NSDictionary *)setup;
 - (void)setDestination:(SKDestination)dest inSetup:(NSMutableDictionary 
*)setup;
 
-- (void)applyLeftSideWidth:(CGFloat)leftSideWidth 
rightSideWidth:(CGFloat)rightSideWidth;
+- (void)applySideWidthsFromSetup:(NSDictionary *)setup;
 
 - (void)updateTableFont;
 
@@ -427,12 +427,8 @@
     
     [pdfView setDelegate:self];
     
-    NSNumber *leftWidthNumber = [savedNormalSetup 
objectForKey:LEFTSIDEPANEWIDTH_KEY] ?: [sud 
objectForKey:SKLeftSidePaneWidthKey];
-    NSNumber *rightWidthNumber = [savedNormalSetup 
objectForKey:RIGHTSIDEPANEWIDTH_KEY] ?: [sud 
objectForKey:SKRightSidePaneWidthKey];
+    [self applySideWidthsFromSetup:savedNormalSetup];
     
-    if (leftWidthNumber && rightWidthNumber)
-        [self applyLeftSideWidth:[leftWidthNumber doubleValue] 
rightSideWidth:[rightWidthNumber doubleValue]];
-    
     // this needs to be done before loading the PDFDocument
     [self resetThumbnailSizeIfNeeded];
     [self resetSnapshotSizeIfNeeded];
@@ -551,9 +547,13 @@
     mwcFlags.settingUpWindow = 0;
 }
 
-- (void)applyLeftSideWidth:(CGFloat)leftSideWidth 
rightSideWidth:(CGFloat)rightSideWidth {
-    [splitView setPosition:leftSideWidth ofDividerAtIndex:0];
-    [splitView setPosition:[splitView maxPossiblePositionOfDividerAtIndex:1] - 
[splitView dividerThickness] - rightSideWidth ofDividerAtIndex:1];
+- (void)applySideWidthsFromSetup:(NSDictionary *)setup {
+    NSNumber *leftWidth = [setup objectForKey:LEFTSIDEPANEWIDTH_KEY];
+    NSNumber *rightWidth = [setup objectForKey:RIGHTSIDEPANEWIDTH_KEY];
+    if (leftWidth && rightWidth) {
+        [splitView setPosition:[leftWidth doubleValue] ofDividerAtIndex:0];
+        [splitView setPosition:[splitView 
maxPossiblePositionOfDividerAtIndex:1] - [splitView dividerThickness] - 
[rightWidth doubleValue] ofDividerAtIndex:1];
+    }
 }
 
 - (void)applySetup:(NSDictionary *)setup{
@@ -571,10 +571,7 @@
                 [savedNormalWindow setFrame:NSRectFromString(rectString) 
display:NO];
         }
         
-        NSNumber *leftWidth = [setup objectForKey:LEFTSIDEPANEWIDTH_KEY];
-        NSNumber *rightWidth = [setup objectForKey:RIGHTSIDEPANEWIDTH_KEY];
-        if (leftWidth && rightWidth)
-            [self applyLeftSideWidth:[leftWidth doubleValue] 
rightSideWidth:[rightWidth doubleValue]];
+        [self applySideWidthsFromSetup:setup];
         
         if ([[pdfView document] isLocked]) {
             NSArray *snapshotSetups = [savedNormalSetup 
objectForKey:SNAPSHOTS_KEY];

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

Reply via email to