Commit a69ec1fe authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: implemented option-click on playlist button to hide the playlist (refs #6122)

(cherry picked from commit 2eda8d45)
parent 5e248470
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
IBOutlet id o_effects_btn; IBOutlet id o_effects_btn;
IBOutlet id o_fullscreen_btn; IBOutlet id o_fullscreen_btn;
IBOutlet id o_search_fld; IBOutlet id o_search_fld;
IBOutlet id o_topbar_view;
IBOutlet id o_volume_sld; IBOutlet id o_volume_sld;
IBOutlet id o_volume_track_view; IBOutlet id o_volume_track_view;
IBOutlet id o_volume_down_btn; IBOutlet id o_volume_down_btn;
...@@ -74,6 +75,8 @@ ...@@ -74,6 +75,8 @@
BOOL b_nativeFullscreenMode; BOOL b_nativeFullscreenMode;
BOOL b_video_playback_enabled; BOOL b_video_playback_enabled;
BOOL b_dropzone_active; BOOL b_dropzone_active;
BOOL b_splitview_removed;
int i_lastSplitViewHeight;
int i_lastShownVolume; int i_lastShownVolume;
input_state_e cachedInputState; input_state_e cachedInputState;
......
...@@ -562,8 +562,45 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -562,8 +562,45 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[VLCCoreInteraction sharedInstance] stop]; [[VLCCoreInteraction sharedInstance] stop];
} }
- (void)resizePlaylistAfterCollapse
{
NSRect plrect;
plrect = [[o_playlist_table animator] frame];
plrect.size.height = i_lastSplitViewHeight - 22.0; // actual pl top bar height, which differs from its frame
[[o_playlist_table animator] setFrame: plrect];
}
- (IBAction)togglePlaylist:(id)sender - (IBAction)togglePlaylist:(id)sender
{ {
if ((([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) != 0) && !b_splitview_removed)
{
NSRect winrect = [self frame];
i_lastSplitViewHeight = [o_split_view frame].size.height;
winrect.size.height = winrect.size.height - i_lastSplitViewHeight;
winrect.origin.y = winrect.origin.y + i_lastSplitViewHeight;
[self setFrame: winrect display: YES animate: YES];
[self performSelector:@selector(hideDropZone) withObject:nil afterDelay:0.1];
b_splitview_removed = YES;
}
else
{
if (b_splitview_removed)
{
NSRect winrect;
winrect = [self frame];
winrect.size.height = winrect.size.height + i_lastSplitViewHeight;
winrect.origin.y = winrect.origin.y - i_lastSplitViewHeight;
[self setFrame: winrect display: YES animate: YES];
[self performSelector:@selector(resizePlaylistAfterCollapse) withObject: nil afterDelay:0.75];
if (b_dropzone_active)
[self performSelector:@selector(showDropZone) withObject: nil afterDelay:0.3];
b_splitview_removed = NO;
return;
}
if (b_dropzone_active && ![[VLCMain sharedInstance] activeVideoPlayback]) if (b_dropzone_active && ![[VLCMain sharedInstance] activeVideoPlayback])
{ {
b_dropzone_active = NO; b_dropzone_active = NO;
...@@ -590,6 +627,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -590,6 +627,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_playlist_table setHidden: NO]; [o_playlist_table setHidden: NO];
[o_video_view setHidden: ![[VLCMain sharedInstance] activeVideoPlayback]]; [o_video_view setHidden: ![[VLCMain sharedInstance] activeVideoPlayback]];
} }
}
} }
- (void)setRepeatOne - (void)setRepeatOne
......
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