Revision: 13400
          http://sourceforge.net/p/skim-app/code/13400
Author:   hofman
Date:     2023-03-22 17:12:42 +0000 (Wed, 22 Mar 2023)
Log Message:
-----------
don't animate table view with reduced motion, it always uses slides

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

Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m        2023-03-22 15:26:07 UTC (rev 13399)
+++ trunk/SKBookmarkController.m        2023-03-22 17:12:42 UTC (rev 13400)
@@ -341,10 +341,8 @@
 
 - (void)insertBookmarks:(NSArray *)newBookmarks atIndexes:(NSIndexSet 
*)indexes ofBookmark:(SKBookmark *)parent animate:(BOOL)animate {
     NSTableViewAnimationOptions options = NSTableViewAnimationEffectGap | 
NSTableViewAnimationSlideDown;
-    if (animate == NO || [self isWindowLoaded] == NO || [[self window] 
isVisible] == NO || [NSView shouldShowFadeAnimation] == NO)
+    if (animate == NO || [self isWindowLoaded] == NO || [[self window] 
isVisible] == NO || [NSView shouldShowSlideAnimation] == NO)
         options = NSTableViewAnimationEffectNone;
-    else if ([NSView shouldShowSlideAnimation] == NO)
-        options = NSTableViewAnimationEffectGap | 
NSTableViewAnimationEffectFade;
     if (needsBeginUpdates) {
         [outlineView beginUpdates];
         needsBeginUpdates = NO;
@@ -355,10 +353,8 @@
 
 - (void)removeBookmarksAtIndexes:(NSIndexSet *)indexes ofBookmark:(SKBookmark 
*)parent animate:(BOOL)animate {
     NSTableViewAnimationOptions options = NSTableViewAnimationEffectGap | 
NSTableViewAnimationSlideUp;
-    if (animate == NO || [self isWindowLoaded] == NO || [[self window] 
isVisible] == NO || [NSView shouldShowFadeAnimation] == NO)
+    if (animate == NO || [self isWindowLoaded] == NO || [[self window] 
isVisible] == NO || [NSView shouldShowSlideAnimation] == NO)
         options = NSTableViewAnimationEffectNone;
-    else if ([NSView shouldShowSlideAnimation] == NO)
-        options = NSTableViewAnimationEffectGap | 
NSTableViewAnimationEffectFade;
     if (needsBeginUpdates) {
         [outlineView beginUpdates];
         needsBeginUpdates = NO;
@@ -377,6 +373,8 @@
 
 - (void)replaceBookmarksAtIndexes:(NSIndexSet *)indexes ofBookmark:(SKBookmark 
*)bookmark withBookmarks:(NSArray *)newBookmarks animate:(BOOL)animate {
     NSIndexSet *removeIndexes = indexes ?: [NSIndexSet 
indexSetWithIndexesInRange:NSMakeRange(0, [bookmark countOfChildren])];
+    if ([NSView shouldShowSlideAnimation] == NO)
+        animate = NO;
     if ([removeIndexes count] > 0)
         [self removeBookmarksAtIndexes:removeIndexes ofBookmark:bookmark 
animate:animate];
     NSIndexSet *insertIndexes = indexes ?: [NSIndexSet 
indexSetWithIndexesInRange:NSMakeRange(0, [newBookmarks count])];

Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m        2023-03-22 15:26:07 UTC (rev 13399)
+++ trunk/SKDownloadController.m        2023-03-22 17:12:42 UTC (rev 13400)
@@ -262,10 +262,8 @@
 - (void)addObjectToDownloads:(SKDownload *)download {
     NSInteger row = [self countOfDownloads];
     NSTableViewAnimationOptions options = NSTableViewAnimationEffectGap | 
NSTableViewAnimationSlideDown;
-    if ([self isWindowLoaded] == NO || [[self window] isVisible] == NO || 
[NSView shouldShowFadeAnimation] == NO)
+    if ([self isWindowLoaded] == NO || [[self window] isVisible] == NO || 
[NSView shouldShowSlideAnimation] == NO)
         options = NSTableViewAnimationEffectNone;
-    else if ([NSView shouldShowSlideAnimation] == NO)
-        options = NSTableViewAnimationEffectGap | 
NSTableViewAnimationEffectFade;
     [tableView beginUpdates];
     [tableView insertRowsAtIndexes:[NSIndexSet indexSetWithIndex:row] 
withAnimation:options];
     [self insertObject:download inDownloadsAtIndex:row];
@@ -274,10 +272,8 @@
 
 - (void)removeObjectsFromDownloadsAtIndexes:(NSIndexSet *)indexes {
     NSTableViewAnimationOptions options = NSTableViewAnimationEffectGap | 
NSTableViewAnimationSlideUp;
-    if ([self isWindowLoaded] == NO || [[self window] isVisible] == NO || 
[NSView shouldShowFadeAnimation] == NO)
+    if ([self isWindowLoaded] == NO || [[self window] isVisible] == NO || 
[NSView shouldShowSlideAnimation] == NO)
         options = NSTableViewAnimationEffectNone;
-    else if ([NSView shouldShowSlideAnimation] == NO)
-        options = NSTableViewAnimationEffectGap | 
NSTableViewAnimationEffectFade;
     [tableView beginUpdates];
     [tableView removeRowsAtIndexes:indexes withAnimation:options];
     [[self mutableArrayValueForKey:DOWNLOADS_KEY] 
removeObjectsAtIndexes:indexes];

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2023-03-22 15:26:07 UTC (rev 13399)
+++ trunk/SKMainWindowController.m      2023-03-22 17:12:42 UTC (rev 13400)
@@ -2359,10 +2359,8 @@
             NSUInteger row = [[rightSideController.snapshotArrayController 
arrangedObjects] indexOfObject:controller];
             if (row != NSNotFound) {
                 NSTableViewAnimationOptions options = 
NSTableViewAnimationEffectGap | NSTableViewAnimationSlideDown;
-                if ([self rightSidePaneIsOpen] == NO || [self 
rightSidePaneState] != SKSidePaneStateSnapshot || [NSView 
shouldShowFadeAnimation] == NO)
+                if ([self rightSidePaneIsOpen] == NO || [self 
rightSidePaneState] != SKSidePaneStateSnapshot || [NSView 
shouldShowSlideAnimation] == NO)
                     options = NSTableViewAnimationEffectNone;
-                else if ([NSView shouldShowSlideAnimation] == NO)
-                    options = NSTableViewAnimationEffectGap | 
NSTableViewAnimationEffectFade;
                 [rightSideController.snapshotTableView 
insertRowsAtIndexes:[NSIndexSet indexSetWithIndex:row] withAnimation:options];
             }
             [rightSideController.snapshotTableView endUpdates];
@@ -2380,10 +2378,8 @@
         NSUInteger row = [[rightSideController.snapshotArrayController 
arrangedObjects] indexOfObject:controller];
         if (row != NSNotFound) {
             NSTableViewAnimationOptions options = 
NSTableViewAnimationEffectGap | NSTableViewAnimationSlideUp;
-            if ([self rightSidePaneIsOpen] == NO || [self rightSidePaneState] 
!= SKSidePaneStateSnapshot || [NSView shouldShowFadeAnimation] == NO)
+            if ([self rightSidePaneIsOpen] == NO || [self rightSidePaneState] 
!= SKSidePaneStateSnapshot || [NSView shouldShowSlideAnimation] == NO)
                 options = NSTableViewAnimationEffectNone;
-            else if ([NSView shouldShowSlideAnimation] == NO)
-                options = NSTableViewAnimationEffectGap | 
NSTableViewAnimationEffectFade;
             [rightSideController.snapshotTableView 
removeRowsAtIndexes:[NSIndexSet indexSetWithIndex:row] withAnimation:options];
         }
         [[self mutableArrayValueForKey:SNAPSHOTS_KEY] removeObject:controller];

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