Commit 1ced7291 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - switch to minimal view should hide and show the menu, now. Close Trax#26

parent 651671b0
...@@ -194,7 +194,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -194,7 +194,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
createSystray(); createSystray();
if( config_GetInt( p_intf, "qt-minimal-view" ) ) if( config_GetInt( p_intf, "qt-minimal-view" ) )
toggleMenus(); toggleMinimalView();
/* Init input manager */ /* Init input manager */
MainInputManager::getInstance( p_intf ); MainInputManager::getInstance( p_intf );
...@@ -621,8 +621,9 @@ void MainInterface::visual() ...@@ -621,8 +621,9 @@ void MainInterface::visual()
} }
#endif #endif
void MainInterface::toggleMenus() void MainInterface::toggleMinimalView()
{ {
TOGGLEV( menuBar() );
TOGGLEV( controls ); TOGGLEV( controls );
TOGGLEV( statusBar() ); TOGGLEV( statusBar() );
updateGeometry(); updateGeometry();
...@@ -916,6 +917,13 @@ void MainInterface::customEvent( QEvent *event ) ...@@ -916,6 +917,13 @@ void MainInterface::customEvent( QEvent *event )
void MainInterface::keyPressEvent( QKeyEvent *e ) 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 ); int i_vlck = qtEventToVLCKey( e );
if( i_vlck >= 0 ) if( i_vlck >= 0 )
{ {
......
...@@ -131,7 +131,7 @@ private: ...@@ -131,7 +131,7 @@ private:
void customEvent( QEvent *); void customEvent( QEvent *);
public slots: public slots:
void undockPlaylist(); void undockPlaylist();
void toggleMenus(); void toggleMinimalView();
void togglePlaylist(); void togglePlaylist();
void toggleUpdateSystrayMenu(); void toggleUpdateSystrayMenu();
void toggleAdvanced(); void toggleAdvanced();
......
...@@ -257,9 +257,10 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi, ...@@ -257,9 +257,10 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
{ {
/* Minimal View */ /* Minimal View */
QAction *action=menu->addAction( qtr( "Minimal View..." ), mi, 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 ); action->setCheckable( true );
if( mi->getControlsVisibilityStatus() & CONTROLS_VISIBLE ) if( mi->getControlsVisibilityStatus() & CONTROLS_VISIBLE )
action->setChecked( true ); action->setChecked( true );
/* Advanced Controls */ /* Advanced Controls */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment