* fade in quicker and fix the fade-in/out problems reported by Benjamin. Thanks for...
authorFelix Paul Kühne <fkuehne@videolan.org>
Thu, 12 Oct 2006 18:24:34 +0000 (18:24 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 12 Oct 2006 18:24:34 +0000 (18:24 +0000)
modules/gui/macosx/fspanel.m

index 05911ec..8d84347 100644 (file)
     [[self contentView] setVolumeLevel: f_volumeLevel];\r
 }\r
 \r
-/* This routine is called repeatedly when the mouse enters the window from outside it. */\r
+/* This routine is called repeatedly to fade in the window */\r
 - (void)focus:(NSTimer *)timer\r
 {\r
     if( [self alphaValue] < 1.0 )\r
     }\r
 }\r
 \r
-/* This routine is called repeatedly when the mouse exits the window from inside it */\r
+/* This routine is called repeatedly to hide the window */\r
 - (void)unfocus:(NSTimer *)timer\r
 {\r
+    if( b_keptVisible )\r
+    {\r
+        b_keptVisible = NO;\r
+        b_fadeQueued = NO;\r
+        [[self fadeTimer] release];\r
+        [self setFadeTimer: NULL];\r
+        [self fadeIn];\r
+        return;\r
+    }\r
     if( [self alphaValue] > 0.0 )\r
         [self setAlphaValue:[self alphaValue]-0.1];\r
     if( [self alphaValue] <= 0.1 )\r
     }\r
 }\r
 \r
-/* If the mouse enters a window, go make sure we fade in */\r
-- (void)mouseEntered:(NSEvent *)theEvent\r
-{\r
-    [self fadeIn];\r
-}\r
-\r
-/* If the mouse exits a window, go make sure we fade out */\r
 - (void)mouseExited:(NSEvent *)theEvent\r
 {\r
-    /* the user left the window, fade out immediatelly and prevent any timer action */\r
-    if( b_alreadyCounting )\r
-    {\r
-        [hideAgainTimer invalidate];\r
-        [hideAgainTimer release];\r
-        b_alreadyCounting = NO;\r
-        hideAgainTimer = NULL;\r
-    }\r
-\r
     /* give up our focus, so the vout may show us again without letting the user clicking it */\r
     if( [[[[VLCMain sharedInstance] getControls] getVoutView] isFullscreen] )\r
         [[[[[VLCMain sharedInstance] getControls] getVoutView] window] makeKeyWindow];\r
-\r
-    [self fadeOut];\r
 }\r
 \r
 - (void)fadeIn\r
     if( [self alphaValue] < 1.0 )\r
     {\r
         if (![self fadeTimer])\r
-            [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(focus:) userInfo:[NSNumber numberWithShort:1] repeats:YES]];\r
+            [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(focus:) userInfo:[NSNumber numberWithShort:1] repeats:YES]];\r
         else if ([[[self fadeTimer] userInfo] shortValue]==0)\r
             b_fadeQueued=YES;\r
     }\r