Commit 6d46730b authored by Felix Paul Kühne's avatar 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)
parent f2d3d72d
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
BOOL b_video_playback_enabled; BOOL b_video_playback_enabled;
BOOL b_dropzone_active; BOOL b_dropzone_active;
BOOL b_splitview_removed; BOOL b_splitview_removed;
BOOL b_minimized_view;
int i_lastSplitViewHeight; int i_lastSplitViewHeight;
int i_lastShownVolume; int i_lastShownVolume;
input_state_e cachedInputState; input_state_e cachedInputState;
......
...@@ -641,8 +641,12 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -641,8 +641,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
} }
BOOL b_activeVideo = [[VLCMain sharedInstance] activeVideoPlayback]; 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]; [self hideSplitView];
} }
...@@ -650,8 +654,16 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -650,8 +654,16 @@ static VLCMainWindow *_o_sharedInstance = nil;
{ {
if (b_splitview_removed) if (b_splitview_removed)
{ {
if( !b_nonembedded ||( sender != nil && b_nonembedded)) if( !b_nonembedded || ( sender != nil && b_nonembedded))
[self showSplitView]; [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) if (b_dropzone_active && !b_activeVideo)
...@@ -662,7 +674,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -662,7 +674,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
if (!b_nonembedded) 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_split_view setHidden: YES];
[o_video_view setHidden: NO]; [o_video_view setHidden: NO];
[self makeFirstResponder: o_video_view]; [self makeFirstResponder: o_video_view];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment