[vlc-commits] Qt: correctly hide/show the statusBar

Jean-Baptiste Kempf git at videolan.org
Tue Apr 12 22:36:25 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Apr 12 22:35:39 2011 +0200| [94348d6dfe2df8d7f7f7f8c67d3caacc243cc43c] | committer: Jean-Baptiste Kempf

Qt: correctly hide/show the statusBar

Sometimes it didn't work, when stopping, as pointed out by Rémi on IRC.

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

 modules/gui/qt4/main_interface.cpp |    8 +++++---
 modules/gui/qt4/main_interface.hpp |    1 +
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 72e05ca..508d9cc 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -136,7 +136,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
      * Status Bar *
      **************/
     createStatusBar();
-    statusBar()->setVisible( getSettings()->value( "status-bar-visible", false ).toBool() );
+    b_statusbarVisible = getSettings()->value( "status-bar-visible", false ).toBool();
+    statusBar()->setVisible( b_statusbarVisible );
 
     /**************************
      *  UI and Widgets design
@@ -305,7 +306,7 @@ MainInterface::~MainInterface()
 
     settings->setValue( "adv-controls",
                         getControlsVisibilityStatus() & CONTROLS_ADVANCED );
-    settings->setValue( "status-bar-visible", statusBar()->isVisible() );
+    settings->setValue( "status-bar-visible", b_statusbarVisible );
 
     /* Save the stackCentralW sizes */
     settings->setValue( "bgSize", stackWidgetsSizes[bgWidget] );
@@ -823,7 +824,7 @@ void MainInterface::setMinimalView( bool b_minimal )
 {
     menuBar()->setVisible( !b_minimal );
     controls->setVisible( !b_minimal );
-    statusBar()->setVisible( !b_minimal );
+    statusBar()->setVisible( !b_minimal && b_statusbarVisible );
     inputC->setVisible( !b_minimal );
 }
 
@@ -872,6 +873,7 @@ int MainInterface::getControlsVisibilityStatus()
 void MainInterface::setStatusBarVisibility( bool b_visible )
 {
     statusBar()->setVisible( b_visible );
+    b_statusbarVisible = b_visible;
 }
 
 #if 0
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index dd37e13..2c24fb7 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -170,6 +170,7 @@ private:
     bool                 b_plDocked;            ///< Is the playlist docked ?
 
     bool                 b_hasPausedWhenMinimized;
+    bool                 b_statusbarVisible;
 
 #ifdef WIN32
     HIMAGELIST himl;



More information about the vlc-commits mailing list