Revision: 16175
          http://sourceforge.net/p/skim-app/code/16175
Author:   hofman
Date:     2026-04-05 15:07:35 +0000 (Sun, 05 Apr 2026)
Log Message:
-----------
add CATransition animation in search: action method rather than animating from 
side view controller

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2026-04-05 14:48:07 UTC (rev 16174)
+++ trunk/SKMainWindowController.m      2026-04-05 15:07:35 UTC (rev 16175)
@@ -375,8 +375,8 @@
     
     [self updateTableFont];
     
-    [leftSideController displayTableAtIndex:mwcFlags.leftSidePaneState 
animate:NO];
-    [rightSideController displayTableAtIndex:mwcFlags.rightSidePaneState 
animate:NO];
+    [leftSideController displayTableAtIndex:mwcFlags.leftSidePaneState];
+    [rightSideController displayTableAtIndex:mwcFlags.rightSidePaneState];
 
     // we need to create the PDFView before setting the toolbar
     pdfView = [[SKPDFView alloc] initWithFrame:[centerContentView bounds]];
@@ -1335,7 +1335,7 @@
     if (mwcFlags.leftSidePaneState != newLeftSidePaneState || [self 
displaysFindPane]) {
         mwcFlags.leftSidePaneState = newLeftSidePaneState;
         
-        [leftSideController displayTableAtIndex:mwcFlags.leftSidePaneState 
animate:NO];
+        [leftSideController displayTableAtIndex:mwcFlags.leftSidePaneState];
     }
 }
 
@@ -1353,7 +1353,7 @@
         
         mwcFlags.rightSidePaneState = newRightSidePaneState;
         
-        [rightSideController displayTableAtIndex:mwcFlags.rightSidePaneState 
animate:NO];
+        [rightSideController displayTableAtIndex:mwcFlags.rightSidePaneState];
     }
 }
 
@@ -1365,12 +1365,12 @@
     if (mwcFlags.findPaneState != newFindPaneState) {
         mwcFlags.findPaneState = newFindPaneState;
         
-        [leftSideController displayTableAtIndex:2 + mwcFlags.findPaneState 
animate:NO];
+        [leftSideController displayTableAtIndex:2 + mwcFlags.findPaneState];
         [self updateFindResultHighlightsForDirection:NSDirectSelection];
         
     } else if ([self displaysFindPane] == NO) {
         
-        [leftSideController displayTableAtIndex:2 + mwcFlags.findPaneState 
animate:NO];
+        [leftSideController displayTableAtIndex:2 + mwcFlags.findPaneState];
     }
 }
 

Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m      2026-04-05 14:48:07 UTC (rev 
16174)
+++ trunk/SKMainWindowController_Actions.m      2026-04-05 15:07:35 UTC (rev 
16175)
@@ -87,6 +87,8 @@
 
 #define MIN_SPLIT_PANE_HEIGHT 50.0
 
+#define SIDEPANE_DURATION 0.7
+
 #define SKShowToolbarInFullScreenKey @"SKShowToolbarInFullScreen"
 
 @interface SKMainWindowController (SKPrivateUI)
@@ -822,8 +824,14 @@
     
     if ([searchString length] == 0) {
         
-        if ([self displaysFindPane])
-            [leftSideController displayTableAtIndex:mwcFlags.leftSidePaneState 
animate:YES];
+        if ([self displaysFindPane]) {
+            if ([NSView shouldShowFadeAnimation]) {
+                CAAnimation *animation = [CATransition animation];
+                [animation setDuration:SIDEPANE_DURATION];
+                [[leftSideController.sideView layer] addAnimation:animation 
forKey:@"animation"];
+            }
+            [leftSideController 
displayTableAtIndex:mwcFlags.leftSidePaneState];
+        }
         [self updateRightStatus];
         
         [self setSearchResults:nil];
@@ -851,8 +859,14 @@
         } else {
             [pdfDoc beginFindString:[sender stringValue] withOptions:options];
         }
-        if ([self displaysFindPane] == NO)
-            [leftSideController displayTableAtIndex:2 + mwcFlags.findPaneState 
animate:YES];
+        if ([self displaysFindPane] == NO) {
+            if ([NSView shouldShowFadeAnimation]) {
+                CAAnimation *animation = [CATransition animation];
+                [animation setDuration:SIDEPANE_DURATION];
+                [[leftSideController.sideView layer] addAnimation:animation 
forKey:@"animation"];
+            }
+            [leftSideController displayTableAtIndex:2 + 
mwcFlags.findPaneState];
+        }
         
         NSPasteboard *findPboard = [NSPasteboard 
pasteboardWithName:NSPasteboardNameFind];
         [findPboard clearContents];

Modified: trunk/SKSideViewController.h
===================================================================
--- trunk/SKSideViewController.h        2026-04-05 14:48:07 UTC (rev 16174)
+++ trunk/SKSideViewController.h        2026-04-05 15:07:35 UTC (rev 16175)
@@ -67,7 +67,7 @@
 
 - (BOOL)requiresAlternateButtonForView:(NSView *)aView;
 
-- (void)displayTableAtIndex:(NSUInteger)idx animate:(BOOL)animate;
+- (void)displayTableAtIndex:(NSUInteger)idx;
 
 @end
 

Modified: trunk/SKSideViewController.m
===================================================================
--- trunk/SKSideViewController.m        2026-04-05 14:48:07 UTC (rev 16174)
+++ trunk/SKSideViewController.m        2026-04-05 15:07:35 UTC (rev 16175)
@@ -45,7 +45,6 @@
 #import "NSView_SKExtensions.h"
 #import "NSWindow_SKExtensions.h"
 
-#define DURATION 0.7
 #define BORDER_INSET 1.0
 
 @implementation SKSideViewController
@@ -92,14 +91,11 @@
     return NO;
 }
 
-- (void)displayTableAtIndex:(NSUInteger)idx animate:(BOOL)animate {
+- (void)displayTableAtIndex:(NSUInteger)idx {
     NSScrollView *newView = [[[self tableViews] objectAtIndex:idx] 
enclosingScrollView];
     if ([newView superview] != nil)
         return;
     
-    if (animate && ([NSView shouldShowFadeAnimation] == NO || [currentView 
window] == nil))
-        animate = NO;
-    
     NSView *oldView = currentView;
     self.currentView = newView;
     
@@ -126,30 +122,14 @@
         [[newView topAnchor] constraintEqualToAnchor:[contentView topAnchor] 
constant:inset],
         [[contentView bottomAnchor] constraintEqualToAnchor:[newView 
bottomAnchor] constant:inset]];
     
-    if (animate == NO) {
-        [contentView replaceSubview:oldView with:newView];
-        [NSLayoutConstraint activateConstraints:constraints];
-        if (changeButton) {
-            [newButton setHidden:NO];
-            [oldButton setHidden:YES];
-        }
-        [[firstResponder window] makeFirstResponder:firstResponder];
-        [[contentView window] recalculateKeyViewLoop];
-    } else {
-        [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
-                [context setDuration:DURATION]; 
-                [[contentView animator] replaceSubview:oldView with:newView];
-                [NSLayoutConstraint activateConstraints:constraints];
-                if (changeButton) {
-                    [[newButton animator] setHidden:NO];
-                    [[oldButton animator] setHidden:YES];
-                }
-            }
-            completionHandler:^{
-                [[firstResponder window] makeFirstResponder:firstResponder];
-                [[contentView window] recalculateKeyViewLoop];
-        }];
+    [contentView replaceSubview:oldView with:newView];
+    [NSLayoutConstraint activateConstraints:constraints];
+    if (changeButton) {
+        [newButton setHidden:NO];
+        [oldButton setHidden:YES];
     }
+    [[firstResponder window] makeFirstResponder:firstResponder];
+    [[contentView window] recalculateKeyViewLoop];
 }
 
 @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