[vlc-commits] Qt: change height when switching from/to minimal interface

Hannes Domani git at videolan.org
Sat Feb 27 16:49:09 CET 2016


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Sat Feb 27 15:54:09 2016 +0100| [a8899ae164387d6fd9d6f7ebd220ed70540c0d19] | committer: Jean-Baptiste Kempf

Qt: change height when switching from/to minimal interface

Close #7950

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/main_interface.cpp |   41 +++++++++++++++++++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 6028b10..9c12ad7 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -821,8 +821,8 @@ void MainInterface::setVideoFullScreen( bool fs )
     {
         /* TODO do we want to restore screen and position ? (when
          * qt-fullscreen-screennumber is forced) */
-        setMinimalView( b_minimalView );
         setInterfaceFullScreen( b_interfaceFullScreen );
+        setMinimalView( b_minimalView );
 #ifdef _WIN32
         changeThumbbarButtons( THEMIM->getIM()->playingStatus() );
 #endif
@@ -979,10 +979,49 @@ void MainInterface::dockPlaylist( bool p_docked )
  */
 void MainInterface::setMinimalView( bool b_minimal )
 {
+    bool b_menuBarVisible = menuBar()->isVisible();
+    bool b_controlsVisible = controls->isVisible();
+    bool b_statusBarVisible = statusBar()->isVisible();
+    bool b_inputCVisible = inputC->isVisible();
+
+    if( !isFullScreen() && !isMaximized() && b_minimal )
+    {
+        int i_heightChange = 0;
+
+        if( b_menuBarVisible )
+            i_heightChange += menuBar()->height();
+        if( b_controlsVisible )
+            i_heightChange += controls->height();
+        if( b_statusBarVisible )
+            i_heightChange += statusBar()->height();
+        if( b_inputCVisible )
+            i_heightChange += inputC->height();
+
+        if( i_heightChange != 0 )
+            resize( width(), height() - i_heightChange );
+    }
+
     menuBar()->setVisible( !b_minimal );
     controls->setVisible( !b_minimal );
     statusBar()->setVisible( !b_minimal && b_statusbarVisible );
     inputC->setVisible( !b_minimal );
+
+    if( !isFullScreen() && !isMaximized() && !b_minimal )
+    {
+        int i_heightChange = 0;
+
+        if( !b_menuBarVisible )
+            i_heightChange += menuBar()->height();
+        if( !b_controlsVisible )
+            i_heightChange += controls->height();
+        if( !b_statusBarVisible && statusBar()->isVisible() )
+            i_heightChange += statusBar()->height();
+        if( !b_inputCVisible )
+            i_heightChange += inputC->height();
+
+        if( i_heightChange != 0 )
+            resize( width(), height() + i_heightChange );
+    }
 }
 
 /*



More information about the vlc-commits mailing list