Revision: 4708
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4708&view=rev
Author:   hofman
Date:     2008-09-29 17:19:18 +0000 (Mon, 29 Sep 2008)

Log Message:
-----------
Fade out the whole fullscreen window because fading a view with NSViewAnimation 
is horrible.

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

Modified: trunk/SKFullScreenWindow.h
===================================================================
--- trunk/SKFullScreenWindow.h  2008-09-29 11:43:39 UTC (rev 4707)
+++ trunk/SKFullScreenWindow.h  2008-09-29 17:19:18 UTC (rev 4708)
@@ -49,6 +49,6 @@
 - (NSView *)mainView;
 - (void)setMainView:(NSView *)view;
 
-- (void)fadeOut;
+- (void)fadeOutBlocking:(BOOL)block;
 
 @end

Modified: trunk/SKFullScreenWindow.m
===================================================================
--- trunk/SKFullScreenWindow.m  2008-09-29 11:43:39 UTC (rev 4707)
+++ trunk/SKFullScreenWindow.m  2008-09-29 17:19:18 UTC (rev 4708)
@@ -124,12 +124,12 @@
     [self setAlphaValue:1.0];
 }
 
-- (void)fadeOut {
+- (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:NSAnimationNonblockingThreaded];
+    [animation setAnimationBlockingMode:block ? NSAnimationBlocking : 
NSAnimationNonblockingThreaded];
     [animation setDuration:1];
     [animation setDelegate:self];
     [animation startAnimation];

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2008-09-29 11:43:39 UTC (rev 4707)
+++ trunk/SKMainWindowController.m      2008-09-29 17:19:18 UTC (rev 4708)
@@ -2475,7 +2475,7 @@
     [mainWindow orderWindow:NSWindowBelow relativeTo:[fullScreenWindow 
windowNumber]];
     [mainWindow makeKeyWindow];
     [mainWindow display];
-    [fullScreenWindow fadeOut];
+    [fullScreenWindow fadeOutBlocking:NO];
     [mainWindow makeFirstResponder:pdfView];
     [mainWindow recalculateKeyViewLoop];
     [mainWindow setDelegate:self];
@@ -2606,20 +2606,22 @@
     if ([[fullScreenWindow firstResponder] isDescendantOf:pdfView])
         [fullScreenWindow makeFirstResponder:nil];
     
-    NSDictionary *fadeOutDict = [NSDictionary 
dictionaryWithObjectsAndKeys:pdfView, NSViewAnimationTargetKey, 
NSViewAnimationFadeOutEffect, NSViewAnimationEffectKey, nil];
-    NSViewAnimation *animation = [[NSViewAnimation alloc] 
initWithViewAnimations:[NSArray arrayWithObjects:fadeOutDict, nil]];
+    SKFullScreenWindow *bgWindow = [[SKFullScreenWindow alloc] 
initWithScreen:[fullScreenWindow screen]];
+    [bgWindow setBackgroundColor:[fullScreenWindow backgroundColor]];
+    [bgWindow setLevel:[fullScreenWindow level]];
+    [bgWindow orderWindow:NSWindowBelow relativeTo:[fullScreenWindow 
windowNumber]];
+    [fullScreenWindow fadeOutBlocking:YES];
     
-    [animation setAnimationBlockingMode:NSAnimationBlocking];
-    [animation setDuration:1.0];
-    [animation startAnimation];
-    [animation release];
-    
-    [pdfView setAlphaValue:1.0];
-    [pdfView setHidden:NO];
     [pdfView setInteractionMode:SKNormalMode screen:[[self window] screen]];
     [pdfView setFrame:[[pdfEdgeView contentView] bounds]];
     [pdfEdgeView addSubview:pdfView]; // this should be done before 
exitPresentationMode to get a smooth transition
     
+    [fullScreenWindow setAlphaValue:1.0];
+    [fullScreenWindow orderWindow:NSWindowBelow relativeTo:[bgWindow 
windowNumber]];
+    [fullScreenWindow displayIfNeeded];
+    [bgWindow orderOut:nil];
+    [bgWindow release];
+    
     if ([self isPresentation])
         [self exitPresentationMode];
     else


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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to