[vlc-commits] macosx: fix 'toggle-sidebar' menu state (close #8213)

Felix Paul Kühne git at videolan.org
Sun Apr 21 23:21:35 CEST 2013


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Apr 21 23:21:26 2013 +0200| [bcfc1800b448162769d5d54a518e2e0898973c1d] | committer: Felix Paul Kühne

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bcfc1800b448162769d5d54a518e2e0898973c1d
---

 modules/gui/macosx/MainMenu.m   |    3 ---
 modules/gui/macosx/MainWindow.m |   15 +++++++--------
 modules/gui/macosx/macosx.m     |    3 ---
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index cffa1c5..2c57585 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -714,10 +714,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
 
 - (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];
-    [o_mi_toggleSidebar setState: b_value];
 }
 
 - (void)updateSidebarMenuItem
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 2479f11..ec59ac4 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -190,11 +190,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
     [self setExcludedFromWindowsMenu: YES];
     [self setAcceptsMouseMovedEvents: YES];
     // 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)];
-    } else {
+    else
         [self setContentMinSize:NSMakeSize(604., 288.)];
-    }
 
     [self setTitle: _NS("VLC media player")];
 
@@ -356,7 +355,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
         o_color_backdrop = [[VLCColorView alloc] initWithFrame: [o_split_view frame]];
         [[self contentView] addSubview: o_color_backdrop positioned: NSWindowBelow relativeTo: o_split_view];
         [o_color_backdrop setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
-
     } else {
         [o_video_view setFrame: [o_split_view frame]];
         [o_playlist_table setBorderType: NSNoBorder];
@@ -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(someWindowWillMiniaturize:) name: NSWindowWillMiniaturizeNotification 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) {
         [self hideSplitView];
@@ -788,8 +786,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
         }
 
     }
-    
-    
+
+
 }
 
 - (void)makeKeyAndOrderFront: (id)sender
@@ -856,7 +854,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     return YES;
 }
 
-- (void)mainSplitViewWillResizeSubviews:(id)object
+- (void)mainSplitViewDidResizeSubviews:(id)object
 {
     i_lastLeftSplitViewWidth = [o_left_split_view frame].size.width;
     config_PutInt(VLCIntf, "macosx-show-sidebar", ![o_split_view isSubviewCollapsed:o_left_split_view]);
@@ -870,6 +868,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
         [o_split_view setPosition:i_lastLeftSplitViewWidth ofDividerAtIndex:0];
     else
         [o_split_view setPosition:[o_split_view minPossiblePositionOfDividerAtIndex:0] ofDividerAtIndex:0];
+    [[[VLCMain sharedInstance] mainMenu] updateSidebarMenuItem];
 }
 
 #pragma mark -
diff --git a/modules/gui/macosx/macosx.m b/modules/gui/macosx/macosx.m
index f380a88..45a3251 100644
--- a/modules/gui/macosx/macosx.m
+++ b/modules/gui/macosx/macosx.m
@@ -147,7 +147,6 @@ vlc_module_begin()
         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-effects-button", false, EFFECTSBUTTON_TEXT, EFFECTSBUTTON_LONGTEXT, false)
-
         add_bool("macosx-show-sidebar", true, SIDEBAR_TEXT, SIDEBAR_LONGTEXT, false)
 
     set_section(N_("Behaviour"), 0)
@@ -160,14 +159,12 @@ vlc_module_begin()
         add_integer("macosx-control-itunes", 1, ITUNES_TEXT, ITUNES_LONGTEXT, false)
         change_integer_list(itunes_list, itunes_list_text)
 
-
     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-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-mediakeys", true, USE_MEDIAKEYS_TEXT, USE_MEDIAKEYS_LONGTEXT, false)
 
-
     add_obsolete_bool("macosx-stretch") /* since 2.0.0 */
     add_obsolete_bool("macosx-eq-keep") /* since 2.0.0 */
     add_obsolete_bool("macosx-autosave-volume") /* since 2.1.0 */



More information about the vlc-commits mailing list