]> git.sesse.net Git - vlc/commitdiff
Qt4 - switch to minimal view should hide and show the menu, now. Close Trax#26
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 24 Oct 2007 05:21:05 +0000 (05:21 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 24 Oct 2007 05:21:05 +0000 (05:21 +0000)
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/menus.cpp

index 47332a5d8a17652bd02864bc21a6dc360695bd87..5466b17f30befa46697efdc257f6349cc6db8291 100644 (file)
@@ -194,7 +194,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
             createSystray();
 
     if( config_GetInt( p_intf, "qt-minimal-view" ) )
-        toggleMenus();
+        toggleMinimalView();
 
     /* Init input manager */
     MainInputManager::getInstance( p_intf );
@@ -621,8 +621,9 @@ void MainInterface::visual()
 }
 #endif
 
-void MainInterface::toggleMenus()
+void MainInterface::toggleMinimalView()
 {
+    TOGGLEV( menuBar() );
     TOGGLEV( controls );
     TOGGLEV( statusBar() );
     updateGeometry();
@@ -916,6 +917,13 @@ void MainInterface::customEvent( QEvent *event )
 
 void MainInterface::keyPressEvent( QKeyEvent *e )
 {
+    if( ( e->modifiers() &  Qt::ControlModifier ) && ( e->key() & Qt::Key_H )
+          && menuBar()->isHidden() )
+    {
+        toggleMinimalView();
+        e->accept();
+    }
+
     int i_vlck = qtEventToVLCKey( e );
     if( i_vlck >= 0 )
     {
index 7f84f5ebf2f116eafbd07213d8ff8f33f867e5a9..def9e0e51206bcaef75c2dacb4079ca0dfdc7027 100644 (file)
@@ -131,7 +131,7 @@ private:
     void customEvent( QEvent *);
 public slots:
     void undockPlaylist();
-    void toggleMenus();
+    void toggleMinimalView();
     void togglePlaylist();
     void toggleUpdateSystrayMenu();
     void toggleAdvanced();
index 5ba6a65f41ec89a4d8ac3c844b59d0c40f3cd8bd..c68999dc3f70f731d2e6de31a82c1fc90331e801 100644 (file)
@@ -257,9 +257,10 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
     {
         /* Minimal View */
         QAction *action=menu->addAction( qtr( "Minimal View..." ), mi,
-                SLOT( toggleMenus() ), qtr( "Ctrl+H" ) );
+                SLOT( toggleMinimalView() ), qtr( "Ctrl+H" ) );
+        //FIXME: remove useless thing. But keep it until the release, pls.
         action->setCheckable( true );
-        if( mi->getControlsVisibilityStatus() & CONTROLS_VISIBLE ) 
+        if( mi->getControlsVisibilityStatus() & CONTROLS_VISIBLE )
             action->setChecked( true );
 
         /* Advanced Controls */