]> git.sesse.net Git - vlc/commitdiff
Qt: correctly recreate the toolbar, taking care about the adv status
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 7 Apr 2010 13:34:02 +0000 (15:34 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 7 Apr 2010 13:34:02 +0000 (15:34 +0200)
modules/gui/qt4/main_interface.cpp

index 4d66b4023849ede4e6a4b812d6056427f683ac4c..53941da1e7a88574bdc93c3b78c94b5539898d39 100644 (file)
@@ -339,11 +339,13 @@ MainInterface::~MainInterface()
  *****************************/
 void MainInterface::recreateToolbars()
 {
+    bool b_adv = getControlsVisibilityStatus() & CONTROLS_ADVANCED;
+
     settings->beginGroup( "MainWindow" );
     delete controls;
     delete inputC;
 
-    controls = new ControlsWidget( p_intf, false, this );
+    controls = new ControlsWidget( p_intf, b_adv, this );
     inputC = new InputControlsWidget( p_intf, this );
 
     if( fullscreenControls )
@@ -768,6 +770,7 @@ void MainInterface::toggleAdvancedButtons()
 /* Get the visibility status of the controls (hidden or not, advanced or not) */
 int MainInterface::getControlsVisibilityStatus()
 {
+    if( !controls ) return 0;
     return( (controls->isVisible() ? CONTROLS_VISIBLE : CONTROLS_HIDDEN )
                 + CONTROLS_ADVANCED * controls->b_advancedVisible );
 }