]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/main_interface.cpp
Qt: speed and time button actionable visual feedback
[vlc] / modules / gui / qt4 / main_interface.cpp
index 5b1fa63f85e400c73511338c0d00773d6ff29dec..99e1409e1f7ed549550385b87c0f0de4b8e0ebb7 100644 (file)
@@ -34,7 +34,7 @@
 #include "actions_manager.hpp"                  // killInstance
 #include "extensions_manager.hpp"               // killInstance
 
-#include "util/customwidgets.hpp"               // qtEventToVLCKey
+#include "util/customwidgets.hpp"               // qtEventToVLCKey, QVLCStackedWidget
 #include "util/qt_dirs.hpp"                     // toNativeSeparators
 
 #include "components/interface_widgets.hpp"     // bgWidget, videoWidget
@@ -75,6 +75,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     bgWidget             = NULL;
     videoWidget          = NULL;
     playlistWidget       = NULL;
+    stackCentralOldWidget= NULL;
 #ifndef HAVE_MAEMO
     sysTray              = NULL;
 #endif
@@ -361,7 +362,7 @@ void MainInterface::createMainWidget( QSettings *settings )
     mainLayout->setSpacing( 0 ); mainLayout->setMargin( 0 );
 
     /* */
-    stackCentralW = new QStackedWidget( main );
+    stackCentralW = new QVLCStackedWidget( main );
 
     /* Bg Cone */
     bgWidget = new BackgroundWidget( p_intf );
@@ -452,6 +453,10 @@ inline void MainInterface::createStatusBar()
     timeLabel->setFrameStyle( QFrame::Sunken | QFrame::Panel );
     speedLabel->setFrameStyle( QFrame::Sunken | QFrame::Panel );
     nameLabel->setFrameStyle( QFrame::Sunken | QFrame::StyledPanel);
+    timeLabel->setStyleSheet(
+            "QLabel:hover { background-color: rgba(255, 255, 255, 50%) }" );
+    speedLabel->setStyleSheet(
+            "QLabel:hover { background-color: rgba(255, 255, 255, 50%) }" );
 
     /* and adding those */
     statusBarr->addWidget( nameLabel, 8 );
@@ -690,15 +695,11 @@ void MainInterface::togglePlaylist()
         /* Playlist is not visible, show it */
         if( stackCentralW->currentWidget() != playlistWidget )
         {
-            playlistWidget->forceShow();
             showTab( playlistWidget );
         }
         else /* Hide it! */
         {
             restoreStackOldWidget();
-            stackCentralW->updateGeometry();
-            // HACK: So it doesn't limit the stackWidget minimumSize
-            playlistWidget->forceHide();
         }
         playlistVisible = ( stackCentralW->currentWidget() == playlistWidget );
     }