Revision: 16183
http://sourceforge.net/p/skim-app/code/16183
Author: hofman
Date: 2026-04-06 16:15:30 +0000 (Mon, 06 Apr 2026)
Log Message:
-----------
don't use CATransition for find pane animations so only the relevant views are
animated
Modified Paths:
--------------
trunk/SKMainWindowController_Actions.m
trunk/SKSideViewController.h
trunk/SKSideViewController.m
trunk/SKStatusBar.m
Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m 2026-04-06 14:46:09 UTC (rev
16182)
+++ trunk/SKMainWindowController_Actions.m 2026-04-06 16:15:30 UTC (rev
16183)
@@ -87,8 +87,6 @@
#define MIN_SPLIT_PANE_HEIGHT 50.0
-#define SIDEPANE_DURATION 0.7
-
#define SKShowToolbarInFullScreenKey @"SKShowToolbarInFullScreen"
@interface SKMainWindowController (SKPrivateUI)
@@ -824,14 +822,8 @@
if ([searchString length] == 0) {
- 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];
- }
+ if ([self displaysFindPane])
+ [leftSideController displayTableAtIndex:mwcFlags.leftSidePaneState
animate:YES];
[self updateRightStatus];
[self setSearchResults:nil];
@@ -859,14 +851,8 @@
} else {
[pdfDoc beginFindString:[sender stringValue] withOptions:options];
}
- 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];
- }
+ if ([self displaysFindPane] == NO)
+ [leftSideController displayTableAtIndex:2 + mwcFlags.findPaneState
animate:YES];
NSPasteboard *findPboard = [NSPasteboard
pasteboardWithName:NSPasteboardNameFind];
[findPboard clearContents];
Modified: trunk/SKSideViewController.h
===================================================================
--- trunk/SKSideViewController.h 2026-04-06 14:46:09 UTC (rev 16182)
+++ trunk/SKSideViewController.h 2026-04-06 16:15:30 UTC (rev 16183)
@@ -67,6 +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-06 14:46:09 UTC (rev 16182)
+++ trunk/SKSideViewController.m 2026-04-06 16:15:30 UTC (rev 16183)
@@ -46,6 +46,7 @@
#import "NSWindow_SKExtensions.h"
#define BORDER_INSET 1.0
+#define DURATION 0.7
@implementation SKSideViewController
@@ -91,11 +92,14 @@
return NO;
}
-- (void)displayTableAtIndex:(NSUInteger)idx {
+- (void)displayTableAtIndex:(NSUInteger)idx animate:(BOOL)animate {
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;
@@ -122,14 +126,30 @@
[[newView topAnchor] constraintEqualToAnchor:[contentView topAnchor]
constant:inset],
[[contentView bottomAnchor] constraintEqualToAnchor:[newView
bottomAnchor] constant:inset]];
- [contentView replaceSubview:oldView with:newView];
- [NSLayoutConstraint activateConstraints:constraints];
- if (changeButton) {
- [newButton setHidden:NO];
- [oldButton setHidden:YES];
+ if (animate) {
+ [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];
+ }
+ }];
+ } else {
+ [contentView replaceSubview:oldView with:newView];
+ [NSLayoutConstraint activateConstraints:constraints];
+ if (changeButton) {
+ [newButton setHidden:NO];
+ [oldButton setHidden:YES];
+ }
}
[[firstResponder window] makeFirstResponder:firstResponder];
[[contentView window] recalculateKeyViewLoop];
}
+- (void)displayTableAtIndex:(NSUInteger)idx {
+ [self displayTableAtIndex:idx animate:NO];
+}
+
@end
Modified: trunk/SKStatusBar.m
===================================================================
--- trunk/SKStatusBar.m 2026-04-06 14:46:09 UTC (rev 16182)
+++ trunk/SKStatusBar.m 2026-04-06 16:15:30 UTC (rev 16183)
@@ -152,7 +152,7 @@
- (void)toggleBelowView:(NSView *)view animate:(BOOL)animate {
if (animating)
return;
- if (animate && [NSView shouldShowSlideAnimation] == NO)
+ if ([NSView shouldShowSlideAnimation] == NO)
animate = NO;
NSView *contentView = [view superview];
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