[vlc-devel] [PATCH] Qt4: change height when switching from/to minimal interface

Hannes Domani ssbssa at yahoo.de
Sat Feb 27 15:54:09 CET 2016


---
 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 c5a8790..f7dc9de 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -823,8 +823,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
@@ -981,10 +981,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 );
+    }
 }
 
 /*
-- 
2.7.1



More information about the vlc-devel mailing list