[vlc-commits] macosx: changed the playlist toggle button behavior (close #6213)

Felix Paul Kühne git at videolan.org
Fri Mar 9 18:59:21 CET 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Mar  9 18:41:16 2012 +0100| [6d46730b31ae26c4c1cc1be922bdab55dcd063b3] | committer: Felix Paul Kühne

macosx: changed the playlist toggle button behavior (close #6213)

it behaves this way now:

- no video => toggle window minimization

- active video in main window => toggle playlist / video

- active detached video => toggle window minimization

- active video in main window, option click on button => toggle window minimization
(cherry picked from commit 797ca65c8f545a22d02ed676711e6f254d5b5dc4)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=6d46730b31ae26c4c1cc1be922bdab55dcd063b3
---

 modules/gui/macosx/MainWindow.h |    1 +
 modules/gui/macosx/MainWindow.m |   18 +++++++++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/MainWindow.h b/modules/gui/macosx/MainWindow.h
index 21bd9dc..d043cd7 100644
--- a/modules/gui/macosx/MainWindow.h
+++ b/modules/gui/macosx/MainWindow.h
@@ -90,6 +90,7 @@
     BOOL b_video_playback_enabled;
     BOOL b_dropzone_active;
     BOOL b_splitview_removed;
+    BOOL b_minimized_view;
     int i_lastSplitViewHeight;
     int i_lastShownVolume;
     input_state_e cachedInputState;
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 8fe5755..e9e4566 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -641,8 +641,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
     }
 
     BOOL b_activeVideo = [[VLCMain sharedInstance] activeVideoPlayback];
+    BOOL b_restored = NO;
 
-    if ( !b_splitview_removed && ( (([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) != 0 && !b_activeVideo) || (b_nonembedded && b_activeVideo && sender != nil) ))
+    if ( !b_splitview_removed && ( (([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) != 0 && b_activeVideo)
+                                  || (b_nonembedded && sender != nil)
+                                  || (!b_activeVideo && sender != nil)
+                                  || b_minimized_view ) )
     {
         [self hideSplitView];
     }
@@ -650,8 +654,16 @@ static VLCMainWindow *_o_sharedInstance = nil;
     {
         if (b_splitview_removed)
         {
-            if( !b_nonembedded ||( sender != nil && b_nonembedded))
+            if( !b_nonembedded || ( sender != nil && b_nonembedded))
                 [self showSplitView];
+
+            if (sender == nil)
+                b_minimized_view = YES;
+            else
+                b_minimized_view = NO;
+
+            if (b_activeVideo)
+                b_restored = YES;
         }
 
         if (b_dropzone_active && !b_activeVideo)
@@ -662,7 +674,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
         if (!b_nonembedded)
         {
-            if ([o_video_view isHidden] && b_activeVideo) {
+            if (([o_video_view isHidden] && b_activeVideo) || b_restored ) {
                 [o_split_view setHidden: YES];
                 [o_video_view setHidden: NO];
                 [self makeFirstResponder: o_video_view];



More information about the vlc-commits mailing list