Revision: 6636
http://skim-app.svn.sourceforge.net/skim-app/?rev=6636&view=rev
Author: hofman
Date: 2010-07-21 11:41:47 +0000 (Wed, 21 Jul 2010)
Log Message:
-----------
methods to support fade in
Modified Paths:
--------------
trunk/SKFullScreenWindow.h
trunk/SKFullScreenWindow.m
Modified: trunk/SKFullScreenWindow.h
===================================================================
--- trunk/SKFullScreenWindow.h 2010-07-21 11:34:55 UTC (rev 6635)
+++ trunk/SKFullScreenWindow.h 2010-07-21 11:41:47 UTC (rev 6636)
@@ -52,5 +52,7 @@
- (void)fadeOutBlocking;
- (void)fadeOut;
+- (void)fadeInBlocking;
+- (void)fadeIn;
@end
Modified: trunk/SKFullScreenWindow.m
===================================================================
--- trunk/SKFullScreenWindow.m 2010-07-21 11:34:55 UTC (rev 6635)
+++ trunk/SKFullScreenWindow.m 2010-07-21 11:41:47 UTC (rev 6636)
@@ -136,6 +136,26 @@
}
}
+- (void)fadeInBlocking:(BOOL)block {
+ if ([[NSUserDefaults standardUserDefaults]
boolForKey:SKDisableAnimationsKey]) {
+ [self setAlphaValue:1.0];
+ [self orderFront:nil];
+ } else {
+ NSDictionary *fadeInDict = [[NSDictionary alloc]
initWithObjectsAndKeys:self, NSViewAnimationTargetKey,
NSViewAnimationFadeInEffect, NSViewAnimationEffectKey, nil];
+ animation = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray
arrayWithObjects:fadeInDict, nil]];
+ [fadeInDict release];
+
+ [self setAlphaValue:0.0];
+ [super orderFront:nil];
+
+ [animation setAnimationBlockingMode:block ? NSAnimationBlocking :
NSAnimationNonblockingThreaded];
+ [animation setAnimationCurve:block ? NSAnimationEaseIn :
NSAnimationEaseInOut];
+ [animation setDuration:0.5];
+ [animation setDelegate:self];
+ [animation startAnimation];
+ }
+}
+
- (void)fadeOutBlocking {
[self fadeOutBlocking:YES];
}
@@ -144,9 +164,19 @@
[self fadeOutBlocking:NO];
}
+- (void)fadeInBlocking {
+ [self fadeInBlocking:YES];
+}
+
+- (void)fadeIn {
+ [self fadeInBlocking:NO];
+}
+
- (void)animationDidEnd:(NSAnimation *)anAnimation {
+ BOOL isFadeOut = [[[[animation viewAnimations] lastObject]
objectForKey:NSViewAnimationEffectKey] isEqual:NSViewAnimationFadeOutEffect];
SKDESTROY(animation);
- [self orderOut:nil];
+ if (isFadeOut)
+ [self orderOut:nil];
[self setAlphaValue:1.0];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit