Revision: 5921
http://skim-app.svn.sourceforge.net/skim-app/?rev=5921&view=rev
Author: hofman
Date: 2009-10-21 14:15:51 +0000 (Wed, 21 Oct 2009)
Log Message:
-----------
also fade out fullscreen window using NSAnimation again, to avoid weird effects
when switching full screen too quickly
Modified Paths:
--------------
trunk/SKFullScreenWindow.m
Modified: trunk/SKFullScreenWindow.m
===================================================================
--- trunk/SKFullScreenWindow.m 2009-10-21 13:59:19 UTC (rev 5920)
+++ trunk/SKFullScreenWindow.m 2009-10-21 14:15:51 UTC (rev 5921)
@@ -40,7 +40,6 @@
#import "SKMainWindowController.h"
#import "NSEvent_SKExtensions.h"
-#define FADEOUT_DURATION 0.5
@implementation SKFullScreenWindow
@@ -53,10 +52,6 @@
[self setAcceptsMouseMovedEvents:YES];
[self setBackgroundColor:[NSColor blackColor]];
[self
setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
- CAAnimation *alphaAnimation = [CABasicAnimation animation];
- [alphaAnimation setDuration:FADEOUT_DURATION];
- [alphaAnimation setTimingFunction:[CAMediaTimingFunction
functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
- [self setAnimations:[NSDictionary
dictionaryWithObjectsAndKeys:alphaAnimation, @"alphaValue", nil]];
}
return self;
}
@@ -130,18 +125,26 @@
[self setAlphaValue:1.0];
}
-- (void)fadeOutBlocking {
+- (void)fadeOutBlocking:(BOOL)block {
NSDictionary *fadeOutDict = [[NSDictionary alloc]
initWithObjectsAndKeys:self, NSViewAnimationTargetKey,
NSViewAnimationFadeOutEffect, NSViewAnimationEffectKey, nil];
animation = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray
arrayWithObjects:fadeOutDict, nil]];
[fadeOutDict release];
- [animation setAnimationBlockingMode:NSAnimationBlocking];
- [animation setAnimationCurve:NSAnimationEaseIn];
- [animation setDuration:FADEOUT_DURATION];
+ [animation setAnimationBlockingMode:block ? NSAnimationBlocking :
NSAnimationNonblockingThreaded];
+ [animation setAnimationCurve:block ? NSAnimationEaseIn :
NSAnimationEaseInOut];
+ [animation setDuration:0.5];
[animation setDelegate:self];
[animation startAnimation];
}
+- (void)fadeOutBlocking {
+ [self fadeOutBlocking:YES];
+}
+
+- (void)fadeOut {
+ [self fadeOutBlocking:NO];
+}
+
- (void)animationDidEnd:(NSAnimation *)anAnimation {
[animation release];
animation = nil;
@@ -156,9 +159,4 @@
[self setAlphaValue:1.0];
}
-- (void)fadeOut {
- [[self animator] setAlphaValue:0.0];
- [self performSelector:@selector(orderOut:) withObject:nil
afterDelay:FADEOUT_DURATION];
-}
-
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit