[vlc-commits] Qt: reinstore the resizeGrip in all cases

Jean-Baptiste Kempf git at videolan.org
Fri Apr 22 00:33:35 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Apr 22 00:32:44 2011 +0200| [9d390b3ae5455a3532936b90a80d83197a0ae933] | committer: Jean-Baptiste Kempf

Qt: reinstore the resizeGrip in all cases

And fix a statusBar bug

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

 modules/gui/qt4/components/controller.cpp |    5 ++++-
 modules/gui/qt4/components/controller.hpp |    7 +++++++
 modules/gui/qt4/main_interface.cpp        |   15 ++++++++-------
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index 31aefd1..d6dadaa 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -604,7 +604,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
 
     setAttribute( Qt::WA_MacBrushedMetal);
     QVBoxLayout *controlLayout = new QVBoxLayout( this );
-    controlLayout->setContentsMargins( 4, 1, 4, 0 );
+    controlLayout->setContentsMargins( 4, 1, 0, 0 );
     controlLayout->setSpacing( 0 );
     QHBoxLayout *controlLayout1 = new QHBoxLayout;
     controlLayout1->setSpacing( 0 ); controlLayout1->setMargin( 0 );
@@ -619,6 +619,9 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
                                         .toString();
     parseAndCreate( line2, controlLayout2 );
 
+    grip = new QSizeGrip( this );
+    controlLayout2->addWidget( grip, 0, Qt::AlignBottom|Qt::AlignRight );
+
     if( !b_advancedVisible && advControls ) advControls->hide();
 
     controlLayout->addLayout( controlLayout1 );
diff --git a/modules/gui/qt4/components/controller.hpp b/modules/gui/qt4/components/controller.hpp
index 05d3826..3278633 100644
--- a/modules/gui/qt4/components/controller.hpp
+++ b/modules/gui/qt4/components/controller.hpp
@@ -32,6 +32,7 @@
 
 #include <QFrame>
 #include <QString>
+#include <QSizeGrip>
 
 #define MAIN_TB1_DEFAULT "64;39;64;38;65"
 #define MAIN_TB2_DEFAULT "0-2;64;3;1;4;64;7;9;64;10;20;19;64-4;37;65;35-4"
@@ -204,11 +205,17 @@ public:
     ControlsWidget( intf_thread_t *_p_i, bool b_advControls,
                     QWidget *_parent = 0 );
 
+    void setGripVisible( bool b_visible )
+    { grip->setVisible( b_visible ); }
+
 protected:
     friend class MainInterface;
 
     bool b_advancedVisible;
 
+private:
+    QSizeGrip *grip;
+
 protected slots:
     void toggleAdvanced();
 
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 508d9cc..7fbb8cb 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -132,13 +132,6 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
 
     settings->endGroup( );
 
-    /**************
-     * Status Bar *
-     **************/
-    createStatusBar();
-    b_statusbarVisible = getSettings()->value( "status-bar-visible", false ).toBool();
-    statusBar()->setVisible( b_statusbarVisible );
-
     /**************************
      *  UI and Widgets design
      **************************/
@@ -152,6 +145,13 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
              this, destroyPopupMenu() );
 
     createMainWidget( settings );
+
+    /**************
+     * Status Bar *
+     **************/
+    createStatusBar();
+    setStatusBarVisibility( getSettings()->value( "MainWindow/status-bar-visible", false ).toBool() );
+
     /*********************************
      * Create the Systray Management *
      *********************************/
@@ -874,6 +874,7 @@ void MainInterface::setStatusBarVisibility( bool b_visible )
 {
     statusBar()->setVisible( b_visible );
     b_statusbarVisible = b_visible;
+    if( controls ) controls->setGripVisible( !b_statusbarVisible );
 }
 
 #if 0



More information about the vlc-commits mailing list