Revision: 16426
          http://sourceforge.net/p/skim-app/code/16426
Author:   hofman
Date:     2026-09-06 09:06:29 +0000 (Sun, 06 Sep 2026)
Log Message:
-----------
observe side pane view frame changes rather than splitview resizing 
notifications

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2026-09-06 08:21:08 UTC (rev 16425)
+++ trunk/SKMainWindowController.m      2026-09-06 09:06:29 UTC (rev 16426)
@@ -2754,7 +2754,7 @@
             else if ([item viewController] == rightSideController)
                 [toolbarController rightSidePaneDidShowOrHide:[item 
isCollapsed] == NO];
             if ([[[self window] frameAutosaveName] length])
-                [self 
performSelectorOnce:@selector(splitViewDidResizeSubviewsDelayed) 
afterDelay:0.0];
+                [self performSelectorOnce:@selector(sidePaneWidthDidChange) 
afterDelay:0.0];
         }
         
     } else if (context == &SKPDFAnnotationPropertiesObservationContext) {

Modified: trunk/SKMainWindowController_UI.h
===================================================================
--- trunk/SKMainWindowController_UI.h   2026-09-06 08:21:08 UTC (rev 16425)
+++ trunk/SKMainWindowController_UI.h   2026-09-06 09:06:29 UTC (rev 16426)
@@ -52,7 +52,7 @@
 
 - (void)handlePageChangedNotification:(nullable NSNotification *)notification;
 
-- (void)splitViewDidResizeSubviewsDelayed;
+- (void)sidePaneWidthDidChange;
 
 - (NSInteger)thumbnailHighlightLevelForRow:(NSInteger)row;
 

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2026-09-06 08:21:08 UTC (rev 16425)
+++ trunk/SKMainWindowController_UI.m   2026-09-06 09:06:29 UTC (rev 16426)
@@ -2097,7 +2097,7 @@
     undoGroupOldPropertiesPerNote = nil;
 }
 
-- (void)splitViewDidResizeSubviewsDelayed {
+- (void)sidePaneWidthDidChange {
     NSSplitViewItem *item = [[splitViewController splitViewItems] firstObject];
     CGFloat width = [item isCollapsed] ? 0.0 : NSWidth([[[item viewController] 
view] frame]);
     [[NSUserDefaults standardUserDefaults] setFloat:width 
forKey:SKLeftSidePaneWidthKey];
@@ -2106,8 +2106,8 @@
     [[NSUserDefaults standardUserDefaults] setFloat:width 
forKey:SKRightSidePaneWidthKey];
 }
 
-- (void)handleSplitViewDidResizeSubviewsNotification:(NSNotification 
*)notification {
-    [self performSelectorOnce:@selector(splitViewDidResizeSubviewsDelayed) 
afterDelay:0.0];
+- (void)handleSidePaneViewFrameDidChangeNotification:(NSNotification 
*)notification {
+    [self performSelectorOnce:@selector(sidePaneWidthDidChange) 
afterDelay:0.0];
 }
 
 #pragma mark Observer registration
@@ -2137,9 +2137,12 @@
     [nc addObserver:self 
selector:@selector(handlePageLabelsChangedNotification:)
                              name:SKPDFPageLabelsChangedNotification 
object:nil];
     // NSSplitView
-    if ([[[self window] frameAutosaveName] length])
-        [nc addObserver:self 
selector:@selector(handleSplitViewDidResizeSubviewsNotification:)
-                   name:NSSplitViewDidResizeSubviewsNotification 
object:[splitViewController splitView]];
+    if ([[[self window] frameAutosaveName] length]) {
+        [nc addObserver:self 
selector:@selector(handleSidePaneViewFrameDidChangeNotification:)
+                   name:NSViewFrameDidChangeNotification 
object:leftSideController.view];
+        [nc addObserver:self 
selector:@selector(handleSidePaneViewFrameDidChangeNotification:)
+                   name:NSViewFrameDidChangeNotification 
object:rightSideController.view];
+    }
 }
 
 @end

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