Revision: 6531
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6531&view=rev
Author:   hofman
Date:     2010-05-12 21:17:21 +0000 (Wed, 12 May 2010)

Log Message:
-----------
hidden preference to disable all animations

Modified Paths:
--------------
    trunk/SKAnimatedBorderlessWindow.m
    trunk/SKSideViewController.m
    trunk/SKSideWindow.m
    trunk/SKSplitView.m
    trunk/SKStatusBar.m
    trunk/SKStringConstants.h
    trunk/SKStringConstants.m

Modified: trunk/SKAnimatedBorderlessWindow.m
===================================================================
--- trunk/SKAnimatedBorderlessWindow.m  2010-05-11 10:25:32 UTC (rev 6530)
+++ trunk/SKAnimatedBorderlessWindow.m  2010-05-12 21:17:21 UTC (rev 6531)
@@ -37,6 +37,7 @@
  */
 
 #import "SKAnimatedBorderlessWindow.h"
+#import "SKStringConstants.h"
 
 #define ALPHA_VALUE 1.0
 #define FADE_IN_DURATION 0.3
@@ -125,11 +126,15 @@
     [self setAlphaValue:[self defaultAlphaValue]];
     [self willClose];
     
-    [NSAnimationContext beginGrouping];
-    [[NSAnimationContext currentContext] setDuration:[self fadeOutDuration]];
-    [[self animator] setAlphaValue:0.0];
-    [NSAnimationContext endGrouping];
-    [self performSelector:@selector(orderOut:) withObject:nil afterDelay:[self 
fadeOutDuration]];
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableAnimationsKey]) {
+        [self orderOut:nil];
+    } else {
+        [NSAnimationContext beginGrouping];
+        [[NSAnimationContext currentContext] setDuration:[self 
fadeOutDuration]];
+        [[self animator] setAlphaValue:0.0];
+        [NSAnimationContext endGrouping];
+        [self performSelector:@selector(orderOut:) withObject:nil 
afterDelay:[self fadeOutDuration]];
+    }
 }
 
 - (void)fadeIn {
@@ -139,11 +144,15 @@
         [self setAlphaValue:0.0];
     [super orderFront:self];
     
-    [NSAnimationContext beginGrouping];
-    [[NSAnimationContext currentContext] setDuration:[self fadeInDuration]];
-    [[self animator] setAlphaValue:[self defaultAlphaValue]];
-    [NSAnimationContext endGrouping];
-    [self fadeOutAfterTimeout];
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableAnimationsKey]) {
+        [self setAlphaValue:[self defaultAlphaValue]];
+    } else {
+        [NSAnimationContext beginGrouping];
+        [[NSAnimationContext currentContext] setDuration:[self 
fadeInDuration]];
+        [[self animator] setAlphaValue:[self defaultAlphaValue]];
+        [NSAnimationContext endGrouping];
+        [self fadeOutAfterTimeout];
+    }
 }
 
 @end

Modified: trunk/SKSideViewController.m
===================================================================
--- trunk/SKSideViewController.m        2010-05-11 10:25:32 UTC (rev 6530)
+++ trunk/SKSideViewController.m        2010-05-12 21:17:21 UTC (rev 6531)
@@ -41,6 +41,7 @@
 #import "SKGradientView.h"
 #import "SKImageToolTipWindow.h"
 #import "NSGeometry_SKExtensions.h"
+#import "SKStringConstants.h"
 
 #define CONTENTVIEW_KEY @"contentView"
 #define BUTTONVIEW_KEY @"buttonView"
@@ -89,6 +90,9 @@
     if ([newView window] != nil)
         return;
     
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableAnimationsKey])
+        animate = NO;
+    
     NSView *oldView = [[currentView retain] autorelease];
     self.currentView = newView;
     

Modified: trunk/SKSideWindow.m
===================================================================
--- trunk/SKSideWindow.m        2010-05-11 10:25:32 UTC (rev 6530)
+++ trunk/SKSideWindow.m        2010-05-12 21:17:21 UTC (rev 6531)
@@ -40,6 +40,7 @@
 #import "SKMainWindowController.h"
 #import "NSBezierPath_SKExtensions.h"
 #import "NSEvent_SKExtensions.h"
+#import "SKStringConstants.h"
 
 #define DEFAULT_WINDOW_WIDTH    300.0
 #define WINDOW_INSET            1.0
@@ -175,7 +176,10 @@
     NSRect frame = [self frame];
     frame.size.width = width;
     frame.origin.x = edge == NSMaxXEdge ? NSMaxX(screenFrame) - width : 
NSMinX(screenFrame);
-    [[self animator] setFrame:frame display:YES];
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableAnimationsKey])
+        [self setFrame:frame display:YES];
+    else
+        [[self animator] setFrame:frame display:YES];
 }
 
 - (void)makeTransparent {

Modified: trunk/SKSplitView.m
===================================================================
--- trunk/SKSplitView.m 2010-05-11 10:25:32 UTC (rev 6530)
+++ trunk/SKSplitView.m 2010-05-12 21:17:21 UTC (rev 6531)
@@ -37,6 +37,7 @@
  */
 
 #import "SKSplitView.h"
+#import "SKStringConstants.h"
 
 #define POSITION_KEY @"position"
 #define DIVIDERINDEX_KEY @"dividerIndex"
@@ -90,6 +91,9 @@
 }
 
 - (void)setPosition:(CGFloat)position ofDividerAtIndex:(NSInteger)dividerIndex 
animate:(BOOL)animate {
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableAnimationsKey])
+        animate = NO;
+    
     if (animating) {
         return;
     } else if (animate == NO) {

Modified: trunk/SKStatusBar.m
===================================================================
--- trunk/SKStatusBar.m 2010-05-11 10:25:32 UTC (rev 6530)
+++ trunk/SKStatusBar.m 2010-05-12 21:17:21 UTC (rev 6531)
@@ -38,6 +38,7 @@
 
 #import "SKStatusBar.h"
 #import "NSGeometry_SKExtensions.h"
+#import "SKStringConstants.h"
 
 #define LEFT_MARGIN         5.0
 #define RIGHT_MARGIN        15.0
@@ -183,6 +184,9 @@
     if (animating)
         return;
     
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableAnimationsKey])
+        animate = NO;
+    
        NSRect viewFrame = [view frame];
        NSView *contentView = [view superview];
        NSRect statusRect = [contentView bounds];

Modified: trunk/SKStringConstants.h
===================================================================
--- trunk/SKStringConstants.h   2010-05-11 10:25:32 UTC (rev 6530)
+++ trunk/SKStringConstants.h   2010-05-12 21:17:21 UTC (rev 6531)
@@ -124,3 +124,4 @@
 extern NSString *SKSequentialPageNumberingKey;
 extern NSString *SKDisablePinchZoomKey;
 extern NSString *SKDisableModificationDateKey;
+extern NSString *SKDisableAnimationsKey;

Modified: trunk/SKStringConstants.m
===================================================================
--- trunk/SKStringConstants.m   2010-05-11 10:25:32 UTC (rev 6530)
+++ trunk/SKStringConstants.m   2010-05-12 21:17:21 UTC (rev 6531)
@@ -125,3 +125,4 @@
 NSString *SKSequentialPageNumberingKey = @"SKSequentialPageNumbering";
 NSString *SKDisablePinchZoomKey = @"SKDisablePinchZoom";
 NSString *SKDisableModificationDateKey = @"SKDisableModificationDate";
+NSString *SKDisableAnimationsKey = @"SKDisableAnimations";


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