diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp index a308ff4c73d8004093c561cfcf9552a1bdbbb4be..300bea7ad843d086a0aee1a9a8dc50d313d12abe 100644 --- a/modules/gui/qt4/main_interface.cpp +++ b/modules/gui/qt4/main_interface.cpp @@ -252,8 +252,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) /* Final sizing and showing */ setVisible( !b_hideAfterCreation ); - setMinimumWidth( __MAX( controls->sizeHint().width(), - menuBar()->sizeHint().width() ) + 30 ); + computeMinimumSize(); /* Switch to minimal view if needed, must be called after the show() */ if( b_minimalView ) @@ -318,6 +317,15 @@ MainInterface::~MainInterface() p_intf->p_sys->p_mi = NULL; } +void MainInterface::computeMinimumSize() +{ + int minWidth = 30; + if( menuBar()->isVisible() ) + minWidth += __MAX( controls->sizeHint().width(), menuBar()->sizeHint().width() ); + + setMinimumWidth( minWidth ); +} + /***************************** * Main UI handling * *****************************/ @@ -813,7 +821,10 @@ void MainInterface::toggleMinimalView( bool b_minimal ) } b_minimalView = b_minimal; if( !b_videoFullScreen ) + { setMinimalView( b_minimalView ); + computeMinimumSize(); + } emit minimalViewToggled( b_minimalView ); } diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp index c8264c796dd7d179c32d3c5614afebba0f2b05b9..a675d87cfd5132c022894e79b7119428bd5a52b9 100644 --- a/modules/gui/qt4/main_interface.hpp +++ b/modules/gui/qt4/main_interface.hpp @@ -120,6 +120,7 @@ private: /* */ void setMinimalView( bool ); void setInterfaceFullScreen( bool ); + void computeMinimumSize(); /* */ QSettings *settings;