]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/main_interface.cpp
Qt4: fix a minor (but annoying) UI glitch on restart
[vlc] / modules / gui / qt4 / main_interface.cpp
index 1a86e3478091d3204731fec25fc1ebaf7b40ab73..17810d90963031d0e7e49a929697a052bf04b00f 100644 (file)
@@ -102,6 +102,9 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     setWindowRole( "vlc-main" );
     setWindowIcon( QApplication::windowIcon() );
     setWindowOpacity( var_InheritFloat( p_intf, "qt-opacity" ) );
+#ifdef Q_WS_MAC
+    setAttribute( Qt::WA_MacBrushedMetal );
+#endif
 
     /* Is video in embedded in the UI or not */
     b_videoEmbedded = var_InheritBool( p_intf, "embedded-video" );
@@ -286,12 +289,7 @@ MainInterface::~MainInterface()
     settings->setValue( "pl-dock-status", b_plDocked );
     /* Save playlist state */
     if( playlistWidget )
-    {
-        settings->setValue( "playlist-visible",
-                            isPlDocked() ?
-                            playlistVisible :
-                            playlistWidget->isVisible() /* FIXME */ );
-    }
+        settings->setValue( "playlist-visible", playlistVisible );
 
     settings->setValue( "adv-controls",
                         getControlsVisibilityStatus() & CONTROLS_ADVANCED );
@@ -470,6 +468,14 @@ inline void MainInterface::createStatusBar()
 
     CONNECT( THEMIM->getIM(), seekRequested( float ),
              timeLabel, setDisplayPosition( float ) );
+
+    /* This shouldn't be necessary, but for somehow reason, the statusBarr
+       starts at height of 20px and when a text is shown it needs more space.
+       But, as the QMainWindow policy doesn't allow statusBar to change QMW's
+       geometry, we need to force a height. If you have a better idea, please
+       tell me -- jb
+     */
+    statusBarr->setFixedHeight( statusBarr->sizeHint().height() + 2 );
 }
 
 /**********************************************************************
@@ -973,7 +979,11 @@ void MainInterface::handleSystrayClick(
     {
         case QSystemTrayIcon::Trigger:
         case QSystemTrayIcon::DoubleClick:
+#ifdef Q_WS_MAC
+            QVLCMenu::updateSystrayMenu( this, p_intf );
+#else
             toggleUpdateSystrayMenu();
+#endif
             break;
         case QSystemTrayIcon::MiddleClick:
             sysTray->showMessage( qtr( "VLC media player" ),
@@ -1064,7 +1074,7 @@ void MainInterface::dropEventPlay( QDropEvent *event, bool b_play )
     {
         if( url.isValid() )
         {
-            char* psz_uri = make_URI( qtu( url.toString() ) );
+            char* psz_uri = make_URI( qtu( url.toString() ), NULL );
             playlist_Add( THEPL, psz_uri, NULL,
                           PLAYLIST_APPEND | (first ? PLAYLIST_GO: PLAYLIST_PREPARSE),
                           PLAYLIST_END, true, pl_Unlocked );
@@ -1080,7 +1090,7 @@ void MainInterface::dropEventPlay( QDropEvent *event, bool b_play )
     if( !mimeData->hasUrls() && mimeData->hasText() &&
         QUrl(mimeData->text()).isValid() )
     {
-        char *psz_uri = make_URI( qtu( mimeData->text() ) );
+        char *psz_uri = make_URI( qtu( mimeData->text() ), NULL );
         playlist_Add( THEPL, psz_uri, NULL,
                       PLAYLIST_APPEND | (first ? PLAYLIST_GO: PLAYLIST_PREPARSE),
                       PLAYLIST_END, true, pl_Unlocked );
@@ -1144,9 +1154,9 @@ void MainInterface::closeEvent( QCloseEvent *e )
 void MainInterface::setInterfaceFullScreen( bool fs )
 {
     if( fs )
-        showFullScreen();
+        setWindowState( windowState() | Qt::WindowFullScreen );
     else
-        showNormal();
+        setWindowState( windowState() & ~Qt::WindowFullScreen );
 }
 void MainInterface::toggleInterfaceFullScreen()
 {