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

macosx: fix 'toggle-sidebar' menu state (close #8213)

parent 10bd3be0
...@@ -714,10 +714,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -714,10 +714,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
- (IBAction)toggleSidebar:(id)sender - (IBAction)toggleSidebar:(id)sender
{ {
BOOL b_value = !config_GetInt(VLCIntf, "macosx-show-sidebar");
config_PutInt(VLCIntf, "macosx-show-sidebar", b_value);
[[[VLCMain sharedInstance] mainWindow] toggleLeftSubSplitView]; [[[VLCMain sharedInstance] mainWindow] toggleLeftSubSplitView];
[o_mi_toggleSidebar setState: b_value];
} }
- (void)updateSidebarMenuItem - (void)updateSidebarMenuItem
......
...@@ -190,11 +190,10 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -190,11 +190,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
[self setExcludedFromWindowsMenu: YES]; [self setExcludedFromWindowsMenu: YES];
[self setAcceptsMouseMovedEvents: YES]; [self setAcceptsMouseMovedEvents: YES];
// Set that here as IB seems to be buggy // Set that here as IB seems to be buggy
if (b_dark_interface) { if (b_dark_interface)
[self setContentMinSize:NSMakeSize(604., 288. + [o_titlebar_view frame].size.height)]; [self setContentMinSize:NSMakeSize(604., 288. + [o_titlebar_view frame].size.height)];
} else { else
[self setContentMinSize:NSMakeSize(604., 288.)]; [self setContentMinSize:NSMakeSize(604., 288.)];
}
[self setTitle: _NS("VLC media player")]; [self setTitle: _NS("VLC media player")];
...@@ -356,7 +355,6 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -356,7 +355,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
o_color_backdrop = [[VLCColorView alloc] initWithFrame: [o_split_view frame]]; o_color_backdrop = [[VLCColorView alloc] initWithFrame: [o_split_view frame]];
[[self contentView] addSubview: o_color_backdrop positioned: NSWindowBelow relativeTo: o_split_view]; [[self contentView] addSubview: o_color_backdrop positioned: NSWindowBelow relativeTo: o_split_view];
[o_color_backdrop setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable]; [o_color_backdrop setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
} else { } else {
[o_video_view setFrame: [o_split_view frame]]; [o_video_view setFrame: [o_split_view frame]];
[o_playlist_table setBorderType: NSNoBorder]; [o_playlist_table setBorderType: NSNoBorder];
...@@ -366,7 +364,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -366,7 +364,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(someWindowWillClose:) name: NSWindowWillCloseNotification object: nil]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(someWindowWillClose:) name: NSWindowWillCloseNotification object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(someWindowWillMiniaturize:) name: NSWindowWillMiniaturizeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(someWindowWillMiniaturize:) name: NSWindowWillMiniaturizeNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(applicationWillTerminate:) name: NSApplicationWillTerminateNotification object: nil]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(applicationWillTerminate:) name: NSApplicationWillTerminateNotification object: nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mainSplitViewWillResizeSubviews:) name:NSSplitViewWillResizeSubviewsNotification object:o_split_view]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(mainSplitViewDidResizeSubviews:) name: NSSplitViewDidResizeSubviewsNotification object:o_split_view];
if (b_splitviewShouldBeHidden) { if (b_splitviewShouldBeHidden) {
[self hideSplitView]; [self hideSplitView];
...@@ -788,8 +786,8 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -788,8 +786,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
} }
} }
} }
- (void)makeKeyAndOrderFront: (id)sender - (void)makeKeyAndOrderFront: (id)sender
...@@ -856,7 +854,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -856,7 +854,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
return YES; return YES;
} }
- (void)mainSplitViewWillResizeSubviews:(id)object - (void)mainSplitViewDidResizeSubviews:(id)object
{ {
i_lastLeftSplitViewWidth = [o_left_split_view frame].size.width; i_lastLeftSplitViewWidth = [o_left_split_view frame].size.width;
config_PutInt(VLCIntf, "macosx-show-sidebar", ![o_split_view isSubviewCollapsed:o_left_split_view]); config_PutInt(VLCIntf, "macosx-show-sidebar", ![o_split_view isSubviewCollapsed:o_left_split_view]);
...@@ -870,6 +868,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -870,6 +868,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_split_view setPosition:i_lastLeftSplitViewWidth ofDividerAtIndex:0]; [o_split_view setPosition:i_lastLeftSplitViewWidth ofDividerAtIndex:0];
else else
[o_split_view setPosition:[o_split_view minPossiblePositionOfDividerAtIndex:0] ofDividerAtIndex:0]; [o_split_view setPosition:[o_split_view minPossiblePositionOfDividerAtIndex:0] ofDividerAtIndex:0];
[[[VLCMain sharedInstance] mainMenu] updateSidebarMenuItem];
} }
#pragma mark - #pragma mark -
......
...@@ -147,7 +147,6 @@ vlc_module_begin() ...@@ -147,7 +147,6 @@ vlc_module_begin()
add_bool("macosx-show-playback-buttons", false, JUMPBUTTONS_TEXT, JUMPBUTTONS_LONGTEXT, false) add_bool("macosx-show-playback-buttons", false, JUMPBUTTONS_TEXT, JUMPBUTTONS_LONGTEXT, false)
add_bool("macosx-show-playmode-buttons", true, PLAYMODEBUTTONS_TEXT, PLAYMODEBUTTONS_LONGTEXT, false) add_bool("macosx-show-playmode-buttons", true, PLAYMODEBUTTONS_TEXT, PLAYMODEBUTTONS_LONGTEXT, false)
add_bool("macosx-show-effects-button", false, EFFECTSBUTTON_TEXT, EFFECTSBUTTON_LONGTEXT, false) add_bool("macosx-show-effects-button", false, EFFECTSBUTTON_TEXT, EFFECTSBUTTON_LONGTEXT, false)
add_bool("macosx-show-sidebar", true, SIDEBAR_TEXT, SIDEBAR_LONGTEXT, false) add_bool("macosx-show-sidebar", true, SIDEBAR_TEXT, SIDEBAR_LONGTEXT, false)
set_section(N_("Behaviour"), 0) set_section(N_("Behaviour"), 0)
...@@ -160,14 +159,12 @@ vlc_module_begin() ...@@ -160,14 +159,12 @@ vlc_module_begin()
add_integer("macosx-control-itunes", 1, ITUNES_TEXT, ITUNES_LONGTEXT, false) add_integer("macosx-control-itunes", 1, ITUNES_TEXT, ITUNES_LONGTEXT, false)
change_integer_list(itunes_list, itunes_list_text) change_integer_list(itunes_list, itunes_list_text)
set_section(N_("Apple Remote and media keys"), 0) set_section(N_("Apple Remote and media keys"), 0)
add_bool("macosx-appleremote", true, USE_APPLE_REMOTE_TEXT, USE_APPLE_REMOTE_LONGTEXT, false) add_bool("macosx-appleremote", true, USE_APPLE_REMOTE_TEXT, USE_APPLE_REMOTE_LONGTEXT, false)
add_bool("macosx-appleremote-sysvol", false, USE_APPLE_REMOTE_VOLUME_TEXT, USE_APPLE_REMOTE_VOLUME_LONGTEXT, false) add_bool("macosx-appleremote-sysvol", false, USE_APPLE_REMOTE_VOLUME_TEXT, USE_APPLE_REMOTE_VOLUME_LONGTEXT, false)
add_bool("macosx-appleremote-prevnext", false, USE_APPLE_REMOTE_PREVNEXT_TEXT, USE_APPLE_REMOTE_PREVNEXT_LONGTEXT, false) add_bool("macosx-appleremote-prevnext", false, USE_APPLE_REMOTE_PREVNEXT_TEXT, USE_APPLE_REMOTE_PREVNEXT_LONGTEXT, false)
add_bool("macosx-mediakeys", true, USE_MEDIAKEYS_TEXT, USE_MEDIAKEYS_LONGTEXT, false) add_bool("macosx-mediakeys", true, USE_MEDIAKEYS_TEXT, USE_MEDIAKEYS_LONGTEXT, false)
add_obsolete_bool("macosx-stretch") /* since 2.0.0 */ add_obsolete_bool("macosx-stretch") /* since 2.0.0 */
add_obsolete_bool("macosx-eq-keep") /* since 2.0.0 */ add_obsolete_bool("macosx-eq-keep") /* since 2.0.0 */
add_obsolete_bool("macosx-autosave-volume") /* since 2.1.0 */ add_obsolete_bool("macosx-autosave-volume") /* since 2.1.0 */
......
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