[vlc-commits] macosx: provide a way to hide the dropzone eventhough the playlist is empty ( just press the toggle pl button)

Felix Paul Kühne git at videolan.org
Thu Feb 16 21:09:01 CET 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Feb 16 21:08:58 2012 +0100| [7f63022f8a94871fd6ca1be2c9c69660ff1d7f6e] | committer: Felix Paul Kühne

macosx: provide a way to hide the dropzone eventhough the playlist is empty (just press the toggle pl button)

close #5925

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7f63022f8a94871fd6ca1be2c9c69660ff1d7f6e
---

 modules/gui/macosx/MainWindow.h |    1 +
 modules/gui/macosx/MainWindow.m |   22 ++++++++++++----------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/modules/gui/macosx/MainWindow.h b/modules/gui/macosx/MainWindow.h
index 5ed8324..80051f0 100644
--- a/modules/gui/macosx/MainWindow.h
+++ b/modules/gui/macosx/MainWindow.h
@@ -73,6 +73,7 @@
     BOOL b_dark_interface;
     BOOL b_nativeFullscreenMode;
     BOOL b_video_playback_enabled;
+    BOOL b_dropzone_active;
     int i_lastShownVolume;
     input_state_e cachedInputState;
 
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index f751eb7..170440b 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -255,7 +255,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     [self setTitle: _NS("VLC media player")];
     [o_time_fld setAlignment: NSCenterTextAlignment];
     [o_time_fld setNeedsDisplay:YES];
-    [o_playlist_btn setEnabled:NO];
+    b_dropzone_active = YES;
     o_temp_view = [[NSView alloc] init];
     [o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
     [o_dropzone_view setFrame: [o_playlist_table frame]];
@@ -562,9 +562,16 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
 - (IBAction)togglePlaylist:(id)sender
 {
+    if (b_dropzone_active)
+    {
+        b_dropzone_active = NO;
+        [self hideDropZone];
+        return;
+    }
+
     if (!b_nonembedded)
     {
-        if ([o_video_view isHidden] && [o_playlist_btn isEnabled]) {
+        if ([o_video_view isHidden] && [[VLCMain sharedInstance] activeVideoPlayback]) {
             [o_split_view setHidden: YES];
             [o_video_view setHidden: NO];
             [self makeFirstResponder: o_video_view];
@@ -935,6 +942,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
 #pragma mark Update interface and respond to foreign events
 - (void)showDropZone
 {
+    b_dropzone_active = YES;
     [o_right_split_view addSubview: o_dropzone_view];
     [o_dropzone_view setFrame: [o_playlist_table frame]];
     [[o_playlist_table animator] setHidden:YES];
@@ -1217,14 +1225,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
 {
     BOOL b_videoPlayback = [[VLCMain sharedInstance] activeVideoPlayback];
 
-    if (!b_nonembedded)
-        [o_playlist_btn setEnabled: b_videoPlayback];
-    else
-    {
-        [o_playlist_btn setEnabled: NO];
-        if (!b_videoPlayback)
-            [o_nonembedded_window orderOut: nil];
-    }
+    if (!b_videoPlayback)
+        [o_nonembedded_window orderOut: nil];
     if( OSX_LION && b_nativeFullscreenMode )
     {
         if( [NSApp presentationOptions] & NSApplicationPresentationFullScreen )



More information about the vlc-commits mailing list