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 47332a5..5466b17 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 7f84f5e..def9e0e 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 5ba6a65..c68999d 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 */