Revision: 16157
          http://sourceforge.net/p/skim-app/code/16157
Author:   hofman
Date:     2026-04-04 14:04:58 +0000 (Sat, 04 Apr 2026)
Log Message:
-----------
Don't remove splitview for overview. Use CATransition to animate.

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2026-04-03 18:27:07 UTC (rev 16156)
+++ trunk/SKMainWindowController.m      2026-04-04 14:04:58 UTC (rev 16157)
@@ -200,10 +200,6 @@
 @property (nonatomic) BOOL revealsOnEdgeHoverInFullscreen;
 @end
 
-@interface NSSplitViewController (SKPrivateDeclarations)
-- (void)_setHasItemToRevealOnEdgeHover:(BOOL)flag;
-@end
-
 @interface SKMainWindowController ()
 
 - (void)cleanup;
@@ -1674,14 +1670,12 @@
     BOOL isPresentation = [self interactionMode] == SKPresentationMode;
     NSView *oldView = isPresentation ? presentationView : [splitViewController 
view];
     NSView *contentView = [oldView superview];
-    BOOL useContentTop = mwcFlags.fullSizeContent || isPresentation;
-    BOOL hasStatus = isPresentation == NO && [statusBar isVisible];
     NSUInteger pageIndex = [[pdfView currentPage] pageIndex];
     NSArray *constraints = @[
-        [[overviewContentView leadingAnchor] 
constraintEqualToAnchor:[contentView leadingAnchor]],
-        [[contentView trailingAnchor] 
constraintEqualToAnchor:[overviewContentView trailingAnchor]],
-        [[overviewContentView topAnchor] 
constraintEqualToAnchor:[(useContentTop ? contentView : [[self window] 
contentLayoutGuide]) topAnchor]],
-        [(hasStatus ? [statusBar topAnchor] : [contentView bottomAnchor]) 
constraintEqualToAnchor:[overviewContentView bottomAnchor]]];
+        [[overviewContentView leadingAnchor] constraintEqualToAnchor:[oldView 
leadingAnchor]],
+        [[oldView trailingAnchor] constraintEqualToAnchor:[overviewContentView 
trailingAnchor]],
+        [[overviewContentView topAnchor] constraintEqualToAnchor:[oldView 
topAnchor]],
+        [[oldView bottomAnchor] constraintEqualToAnchor:[overviewContentView 
bottomAnchor]]];
     
     [overviewContentView setFrame:[oldView frame]];
     [overviewView scrollRectToVisible:[overviewView 
frameForItemAtIndex:pageIndex]];
@@ -1710,19 +1704,15 @@
     }
     
     if (animate) {
-        [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
-                [context setDuration:0.5];
-                [[contentView animator] replaceSubview:oldView 
with:overviewContentView];
-                [NSLayoutConstraint activateConstraints:constraints];
-            }
-            completionHandler:^{
-                [overviewView scrollRectToVisible:[overviewView 
frameForItemAtIndex:pageIndex]];
-            }];
-    } else {
-        [contentView replaceSubview:oldView with:overviewContentView];
-        [NSLayoutConstraint activateConstraints:constraints];
-        [overviewView scrollRectToVisible:[overviewView 
frameForItemAtIndex:[[pdfView currentPage] pageIndex]]];
+        CAAnimation *animation = [CATransition animation];
+        [animation setDuration:0.5];
+        [[contentView layer] addAnimation:animation forKey:@"transition"];
     }
+    
+    [contentView addSubview:overviewContentView];
+    [oldView setHidden:YES];
+    [NSLayoutConstraint activateConstraints:constraints];
+    dispatch_async(dispatch_get_main_queue(), ^{ [overviewView 
scrollRectToVisible:[overviewView frameForItemAtIndex:[[pdfView currentPage] 
pageIndex]]]; });
     if (isPresentation)
         [NSCursor setHiddenUntilMouseMoves:NO];
     [[self window] makeFirstResponder:overviewView];
@@ -1753,30 +1743,29 @@
         [(hasStatus ? [statusBar topAnchor] : [contentView bottomAnchor]) 
constraintEqualToAnchor:[newView bottomAnchor]]];
     
     if (animate) {
-        [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
-                [context setDuration:0.5];
-                [[contentView animator] replaceSubview:overviewContentView 
with:newView];
-                [NSLayoutConstraint activateConstraints:constraints];
-            }
-            completionHandler:^{
-                [[contentView window] makeFirstResponder:isPresentation ? 
presentationView : pdfView];
-                [[contentView window] recalculateKeyViewLoop];
-                if (handler)
-                    handler();
-            }];
-    } else {
-        [contentView replaceSubview:overviewContentView with:newView];
-        [NSLayoutConstraint activateConstraints:constraints];
-        [[contentView window] makeFirstResponder:isPresentation ? 
presentationView : pdfView];
-        [[contentView window] recalculateKeyViewLoop];
-        if (handler)
+        if (handler) {
+            [CATransaction begin];
+            [CATransaction setCompletionBlock:handler];
+        }
+        CAAnimation *animation = [CATransition animation];
+        [animation setDuration:0.5];
+        [[contentView layer] addAnimation:animation forKey:@"transition"];
+    }
+    
+    [overviewContentView removeFromSuperview];
+    [newView setHidden:NO];
+    [NSLayoutConstraint activateConstraints:constraints];
+    [[contentView window] makeFirstResponder:isPresentation ? presentationView 
: pdfView];
+    [[contentView window] recalculateKeyViewLoop];
+    
+    if (handler) {
+        if (animate)
+            [CATransaction commit];
+        else
             handler();
     }
+    
     [[NSNotificationCenter defaultCenter] 
postNotificationName:SKMainWindowControllerDidShowOrHideOverviewNotification 
object:self];
-    if ([splitViewController 
respondsToSelector:@selector(_setHasItemToRevealOnEdgeHover:)]) {
-        [splitViewController _setHasItemToRevealOnEdgeHover:NO];
-        [splitViewController _setHasItemToRevealOnEdgeHover:YES];
-    }
 }
 
     

Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m      2026-04-03 18:27:07 UTC (rev 
16156)
+++ trunk/SKMainWindowController_Actions.m      2026-04-04 14:04:58 UTC (rev 
16157)
@@ -778,8 +778,7 @@
 
 - (IBAction)toggleStatusBar:(id)sender {
     [[NSUserDefaults standardUserDefaults] setBool:(NO == [statusBar 
isVisible]) forKey:SKShowStatusBarKey];
-    NSView *view = [self hasOverview] ? overviewContentView : 
[splitViewController view];
-    [statusBar toggleBelowView:view animate:sender != nil];
+    [statusBar toggleBelowView:[splitViewController view] animate:sender != 
nil];
 }
 
 - (void)selectSearchFieldForSideViewController:(SKSideViewController 
*)sideViewController {

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