Revision: 3288
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3288&view=rev
Author:   hofman
Date:     2007-11-30 10:45:24 -0800 (Fri, 30 Nov 2007)

Log Message:
-----------
Animate tables and segmented controls subsequently, as doing it together leads 
to flickering.

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2007-11-30 18:11:22 UTC (rev 3287)
+++ trunk/SKMainWindowController.m      2007-11-30 18:45:24 UTC (rev 3288)
@@ -2567,7 +2567,6 @@
 
 - (void)replaceSideView:(NSView *)oldView withView:(NSView *)newView 
animate:(BOOL)animate {
     if ([newView window] == nil) {
-        NSMutableArray *viewAnimations = animate ? [NSMutableArray 
arrayWithCapacity:4] : nil;
         NSResponder *oldFirstResponder = [[oldView window] firstResponder];
         BOOL wasFind = [oldView isEqual:findView] || [oldView 
isEqual:groupedFindView];
         BOOL isFind = [newView isEqual:findView] || [newView 
isEqual:groupedFindView];
@@ -2582,10 +2581,6 @@
             [newButton setFrame:[oldButton frame]];
             [newButton setHidden:animate];
             [[oldButton superview] addSubview:newButton];
-            if (animate) {
-                [viewAnimations addObject:[NSDictionary 
dictionaryWithObjectsAndKeys:oldButton, NSViewAnimationTargetKey, 
NSViewAnimationFadeOutEffect, NSViewAnimationEffectKey, nil]];
-                [viewAnimations addObject:[NSDictionary 
dictionaryWithObjectsAndKeys:newButton, NSViewAnimationTargetKey, 
NSViewAnimationFadeInEffect, NSViewAnimationEffectKey, nil]];
-            }
         }
         
         [newView setFrame:[oldView frame]];
@@ -2593,17 +2588,29 @@
         [[oldView superview] addSubview:newView];
         
         if (animate) {
-            [viewAnimations addObject:[NSDictionary 
dictionaryWithObjectsAndKeys:oldView, NSViewAnimationTargetKey, 
NSViewAnimationFadeOutEffect, NSViewAnimationEffectKey, nil]];
-            [viewAnimations addObject:[NSDictionary 
dictionaryWithObjectsAndKeys:newView, NSViewAnimationTargetKey, 
NSViewAnimationFadeInEffect, NSViewAnimationEffectKey, nil]];
+            NSArray *viewAnimations = [NSArray arrayWithObjects:
+                [NSDictionary dictionaryWithObjectsAndKeys:oldView, 
NSViewAnimationTargetKey, NSViewAnimationFadeOutEffect, 
NSViewAnimationEffectKey, nil],
+                [NSDictionary dictionaryWithObjectsAndKeys:newView, 
NSViewAnimationTargetKey, NSViewAnimationFadeInEffect, 
NSViewAnimationEffectKey, nil], nil];
             
             NSViewAnimation *animation = [[[NSViewAnimation alloc] 
initWithViewAnimations:viewAnimations] autorelease];
-            
             [animation setAnimationBlockingMode:NSAnimationBlocking];
-            [animation setDuration:0.75];
+            [animation setDuration:0.7];
             [animation setAnimationCurve:NSAnimationEaseIn];
             isAnimating = YES;
             [animation startAnimation];
             isAnimating = NO;
+            
+            if (wasFind != isFind) {
+                viewAnimations = [NSArray arrayWithObjects:
+                    [NSDictionary dictionaryWithObjectsAndKeys:oldButton, 
NSViewAnimationTargetKey, NSViewAnimationFadeOutEffect, 
NSViewAnimationEffectKey, nil],
+                    [NSDictionary dictionaryWithObjectsAndKeys:newButton, 
NSViewAnimationTargetKey, NSViewAnimationFadeInEffect, 
NSViewAnimationEffectKey, nil], nil];
+                
+                animation = [[[NSViewAnimation alloc] 
initWithViewAnimations:viewAnimations] autorelease];
+                [animation setAnimationBlockingMode:NSAnimationBlocking];
+                [animation setDuration:0.3];
+                [animation setAnimationCurve:NSAnimationEaseIn];
+                [animation startAnimation];
+            }
         }
         
         if ([oldFirstResponder isDescendantOf:oldView])
@@ -2615,6 +2622,7 @@
         if (wasFind != isFind) {
             [containerView addSubview:oldButton];
             [oldButton setHidden:NO];
+            [newButton setHidden:NO];
             if ([oldFirstResponder isEqual:oldButton])
                 [[newButton window] makeFirstResponder:newButton];
         }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to