Commit 2eda8d45 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)

parent 122e64fa
......@@ -43,6 +43,7 @@
IBOutlet id o_effects_btn;
IBOutlet id o_fullscreen_btn;
IBOutlet id o_search_fld;
IBOutlet id o_topbar_view;
IBOutlet id o_volume_sld;
IBOutlet id o_volume_track_view;
IBOutlet id o_volume_down_btn;
......@@ -74,6 +75,8 @@
BOOL b_nativeFullscreenMode;
BOOL b_video_playback_enabled;
BOOL b_dropzone_active;
BOOL b_splitview_removed;
int i_lastSplitViewHeight;
int i_lastShownVolume;
input_state_e cachedInputState;
......
......@@ -562,34 +562,72 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[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
{
if (b_dropzone_active && ![[VLCMain sharedInstance] activeVideoPlayback])
if ((([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) != 0) && !b_splitview_removed)
{
b_dropzone_active = NO;
[self hideDropZone];
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;
}
if (!b_nonembedded)
else
{
if ([o_video_view isHidden] && [[VLCMain sharedInstance] activeVideoPlayback]) {
[o_split_view setHidden: YES];
[o_video_view setHidden: NO];
[self makeFirstResponder: o_video_view];
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])
{
b_dropzone_active = NO;
[self hideDropZone];
}
if (!b_nonembedded)
{
if ([o_video_view isHidden] && [[VLCMain sharedInstance] activeVideoPlayback]) {
[o_split_view setHidden: YES];
[o_video_view setHidden: NO];
[self makeFirstResponder: o_video_view];
}
else
{
[o_video_view setHidden: YES];
[o_split_view setHidden: NO];
[self makeFirstResponder: nil];
}
}
else
{
[o_video_view setHidden: YES];
[o_split_view setHidden: NO];
[self makeFirstResponder: nil];
[o_playlist_table setHidden: NO];
[o_video_view setHidden: ![[VLCMain sharedInstance] activeVideoPlayback]];
}
}
else
{
[o_split_view setHidden: NO];
[o_playlist_table setHidden: NO];
[o_video_view setHidden: ![[VLCMain sharedInstance] activeVideoPlayback]];
}
}
- (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