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

Hannes Domani git at videolan.org
Sat Feb 27 18:10:43 CET 2016


vlc/vlc-2.2 | branch: master | Hannes Domani <ssbssa at yahoo.de> | Sat Feb 27 15:54:09 2016 +0100| [7fd9a335f3c3c68a03b67e647635ed97080eec2b] | 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>
(cherry picked from commit a8899ae164387d6fd9d6f7ebd220ed70540c0d19)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 8c911e8..d02f353 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -830,8 +830,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
@@ -988,10 +988,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