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
......@@ -21,16 +21,16 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="4722"/>
<integer value="4850"/>
<integer value="1617"/>
<integer value="2770"/>
<integer value="29"/>
<integer value="21"/>
<integer value="2730"/>
<integer value="4596"/>
<integer value="283"/>
<integer value="4850"/>
<integer value="4596"/>
<integer value="2730"/>
<integer value="29"/>
<integer value="2770"/>
<integer value="4682"/>
<integer value="915"/>
<integer value="4722"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -11884,7 +11884,7 @@ LCAuLi4</string>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">4946</int>
<int key="maxID">4947</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
......@@ -14863,6 +14863,386 @@ LCAuLi4</string>
<string key="superclassName">VLCCustomWindowButtonPrototype</string>
<reference key="sourceIdentifier" ref="672431580"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCMainWindow</string>
<string key="superclassName">NSWindow</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>bwd:</string>
<string>customZoom:</string>
<string>dropzoneButtonAction:</string>
<string>effects:</string>
<string>fullscreen:</string>
<string>fwd:</string>
<string>play:</string>
<string>repeat:</string>
<string>shuffle:</string>
<string>stop:</string>
<string>timeSliderAction:</string>
<string>togglePlaylist:</string>
<string>volumeAction:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>bwd:</string>
<string>customZoom:</string>
<string>dropzoneButtonAction:</string>
<string>effects:</string>
<string>fullscreen:</string>
<string>fwd:</string>
<string>play:</string>
<string>repeat:</string>
<string>shuffle:</string>
<string>stop:</string>
<string>timeSliderAction:</string>
<string>togglePlaylist:</string>
<string>volumeAction:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBActionInfo">
<string key="name">bwd:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">customZoom:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">dropzoneButtonAction:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">effects:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">fullscreen:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">fwd:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">play:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">repeat:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">shuffle:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">stop:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">timeSliderAction:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">togglePlaylist:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">volumeAction:</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>o_bottombar_view</string>
<string>o_bwd_btn</string>
<string>o_chosen_category_lbl</string>
<string>o_dropzone_btn</string>
<string>o_dropzone_lbl</string>
<string>o_dropzone_view</string>
<string>o_effects_btn</string>
<string>o_fspanel</string>
<string>o_fullscreen_btn</string>
<string>o_fwd_btn</string>
<string>o_left_split_view</string>
<string>o_play_btn</string>
<string>o_playlist_btn</string>
<string>o_playlist_table</string>
<string>o_progress_bar</string>
<string>o_repeat_btn</string>
<string>o_resize_view</string>
<string>o_right_split_view</string>
<string>o_search_fld</string>
<string>o_shuffle_btn</string>
<string>o_sidebar_scrollview</string>
<string>o_sidebar_view</string>
<string>o_split_view</string>
<string>o_stop_btn</string>
<string>o_time_fld</string>
<string>o_time_sld</string>
<string>o_time_sld_background</string>
<string>o_time_sld_fancygradient_view</string>
<string>o_titlebar_view</string>
<string>o_topbar_view</string>
<string>o_video_view</string>
<string>o_volume_down_btn</string>
<string>o_volume_sld</string>
<string>o_volume_track_view</string>
<string>o_volume_up_btn</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>VLCFSPanel</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>o_bottombar_view</string>
<string>o_bwd_btn</string>
<string>o_chosen_category_lbl</string>
<string>o_dropzone_btn</string>
<string>o_dropzone_lbl</string>
<string>o_dropzone_view</string>
<string>o_effects_btn</string>
<string>o_fspanel</string>
<string>o_fullscreen_btn</string>
<string>o_fwd_btn</string>
<string>o_left_split_view</string>
<string>o_play_btn</string>
<string>o_playlist_btn</string>
<string>o_playlist_table</string>
<string>o_progress_bar</string>
<string>o_repeat_btn</string>
<string>o_resize_view</string>
<string>o_right_split_view</string>
<string>o_search_fld</string>
<string>o_shuffle_btn</string>
<string>o_sidebar_scrollview</string>
<string>o_sidebar_view</string>
<string>o_split_view</string>
<string>o_stop_btn</string>
<string>o_time_fld</string>
<string>o_time_sld</string>
<string>o_time_sld_background</string>
<string>o_time_sld_fancygradient_view</string>
<string>o_titlebar_view</string>
<string>o_topbar_view</string>
<string>o_video_view</string>
<string>o_volume_down_btn</string>
<string>o_volume_sld</string>
<string>o_volume_track_view</string>
<string>o_volume_up_btn</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">o_bottombar_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_bwd_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_chosen_category_lbl</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_dropzone_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_dropzone_lbl</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_dropzone_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_effects_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_fspanel</string>
<string key="candidateClassName">VLCFSPanel</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_fullscreen_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_fwd_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_left_split_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_play_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_playlist_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_playlist_table</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_progress_bar</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_repeat_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_resize_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_right_split_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_search_fld</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_shuffle_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_sidebar_scrollview</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_sidebar_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_split_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_stop_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_time_fld</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_time_sld</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_time_sld_background</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_time_sld_fancygradient_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_titlebar_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_topbar_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_video_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_volume_down_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_volume_sld</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_volume_track_view</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_volume_up_btn</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBDocumentRelativeSource</string>
<string key="minorKey">../../../../../modules/gui/macosx/MainWindow.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCMainWindowSplitView</string>
<string key="superclassName">NSSplitView</string>
......
......@@ -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