Revision: 5738
http://skim-app.svn.sourceforge.net/skim-app/?rev=5738&view=rev
Author: hofman
Date: 2009-09-10 13:25:46 +0000 (Thu, 10 Sep 2009)
Log Message:
-----------
use animator to fade out full screen window
Modified Paths:
--------------
trunk/SKFullScreenWindow.h
trunk/SKFullScreenWindow.m
Modified: trunk/SKFullScreenWindow.h
===================================================================
--- trunk/SKFullScreenWindow.h 2009-09-10 13:10:32 UTC (rev 5737)
+++ trunk/SKFullScreenWindow.h 2009-09-10 13:25:46 UTC (rev 5738)
@@ -40,9 +40,7 @@
#import "SKMainWindow.h"
-...@interface SKFullScreenWindow : SKMainWindow <NSAnimationDelegate> {
- NSViewAnimation *animation;
-}
+...@interface SKFullScreenWindow : SKMainWindow
- (id)initWithScreen:(NSScreen *)screen;
Modified: trunk/SKFullScreenWindow.m
===================================================================
--- trunk/SKFullScreenWindow.m 2009-09-10 13:10:32 UTC (rev 5737)
+++ trunk/SKFullScreenWindow.m 2009-09-10 13:25:46 UTC (rev 5738)
@@ -56,17 +56,6 @@
return self;
}
-- (void)stopAnimation {
- [animation stopAnimation];
- [animation release];
- animation = nil;
-}
-
-- (void)dealloc {
- [self stopAnimation];
- [super dealloc];
-}
-
- (BOOL)canBecomeKeyWindow { return YES; }
- (BOOL)canBecomeMainWindow { return YES; }
@@ -108,51 +97,35 @@
}
- (void)orderFront:(id)sender {
- [self stopAnimation];
[self setAlphaValue:1.0];
[super orderFront:sender];
}
- (void)makeKeyAndOrderFront:(id)sender {
- [self stopAnimation];
[self setAlphaValue:1.0];
[super makeKeyAndOrderFront:sender];
}
- (void)orderOut:(id)sender {
- [self stopAnimation];
[super orderOut:sender];
[self setAlphaValue:1.0];
}
- (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:block ? NSAnimationBlocking :
NSAnimationNonblockingThreaded];
- [animation setAnimationCurve:block ? NSAnimationEaseIn :
NSAnimationEaseInOut];
- [animation setDuration:0.7];
- [animation setDelegate:self];
- [animation startAnimation];
+ [NSAnimationContext beginGrouping];
+ [[NSAnimationContext currentContext] setDuration:0.7];
+ [[self animator] setAlphaValue:0.0];
+ [NSAnimationContext endGrouping];
+ if (block) {
+ [[NSRunLoop currentRunLoop] runUntilDate:[NSDate
dateWithTimeIntervalSinceNow:0.7]];
+ [self orderOut:nil];
+ } else {
+ [self performSelector:@selector(orderOut:) withObject:nil
afterDelay:0.7];
+ }
}
- (void)fadeOut {
return [self fadeOutBlocking:NO];
}
-- (void)animationDidEnd:(NSAnimation *)anAnimation {
- [animation release];
- animation = nil;
- [self orderOut:nil];
- [self setAlphaValue:1.0];
-}
-
-- (void)animationDidStop:(NSAnimation *)anAnimation {
- [animation release];
- animation = nil;
- [self orderOut:nil];
- [self setAlphaValue:1.0];
-}
-
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit