Revision: 12076
          http://sourceforge.net/p/skim-app/code/12076
Author:   hofman
Date:     2020-11-30 22:35:56 +0000 (Mon, 30 Nov 2020)
Log Message:
-----------
Don't animate presentation window when animation is disabled

Modified Paths:
--------------
    trunk/SKFullScreenWindow.m

Modified: trunk/SKFullScreenWindow.m
===================================================================
--- trunk/SKFullScreenWindow.m  2020-11-30 22:29:47 UTC (rev 12075)
+++ trunk/SKFullScreenWindow.m  2020-11-30 22:35:56 UTC (rev 12076)
@@ -66,31 +66,39 @@
 - (BOOL)canBecomeMainWindow { return isMain; }
 
 - (void)fadeOutBlocking:(BOOL)blocking {
-    __block BOOL wait = blocking;
-    [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
-        [context setDuration:DURATION];
-        [[self animator] setAlphaValue:0.0];
-    } completionHandler:^{
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableAnimationsKey]) {
         [self orderOut:nil];
-        [self setAlphaValue:1.0];
-        wait = NO;
-    }];
-    NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
-    while (wait && [runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate 
distantFuture]]);
+    } else {
+        __block BOOL wait = blocking;
+        [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
+            [context setDuration:DURATION];
+            [[self animator] setAlphaValue:0.0];
+        } completionHandler:^{
+            [self orderOut:nil];
+            [self setAlphaValue:1.0];
+            wait = NO;
+        }];
+        NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
+        while (wait && [runLoop runMode:NSDefaultRunLoopMode 
beforeDate:[NSDate distantFuture]]);
+    }
 }
 
 - (void)fadeInBlocking:(BOOL)blocking {
-    __block BOOL wait = blocking;
-    [self setAlphaValue:0.0];
-    [self orderFront:nil];
-    [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
-        [context setDuration:DURATION];
-        [[self animator] setAlphaValue:1.0];
-    } completionHandler:^{
-        wait = NO;
-    }];
-    NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
-    while (wait && [runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate 
distantFuture]]);
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableAnimationsKey]) {
+        [self orderFront:nil];
+    } else {
+        __block BOOL wait = blocking;
+        [self setAlphaValue:0.0];
+        [self orderFront:nil];
+        [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
+            [context setDuration:DURATION];
+            [[self animator] setAlphaValue:1.0];
+        } completionHandler:^{
+            wait = NO;
+        }];
+        NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
+        while (wait && [runLoop runMode:NSDefaultRunLoopMode 
beforeDate:[NSDate distantFuture]]);
+    }
 }
 
 - (void)sendEvent:(NSEvent *)theEvent {

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