/* And switch to minimal view if needed
Must be called after the show() */
if( i_visualmode == QT_MINIMAL_MODE )
- toggleMinimalView();
+ toggleMinimalView( true );
/* Update the geometry : It is useful if you switch between
qt-display-modes ?*/
{
}
-void MainInterface::toggleMinimalView()
+void MainInterface::toggleMinimalView( bool b_switch )
{
if( i_visualmode != QT_ALWAYS_VIDEO_MODE &&
i_visualmode != QT_MINIMAL_MODE )
}
}
- TOGGLEV( menuBar() );
- TOGGLEV( controls );
- TOGGLEV( statusBar() );
- TOGGLEV( inputC );
+ menuBar()->setVisible( !b_switch );
+ controls->setVisible( !b_switch );
+ statusBar()->setVisible( !b_switch );
+ inputC->setVisible( !b_switch );
doComponentsUpdate();
- QVLCMenu::minimalViewAction->setChecked( bgWasVisible );
+ emit minimalViewToggled( b_switch );
}
/* Video widget cannot do this synchronously as it runs in another thread */
/* Get the visibility status of the controls (hidden or not, advanced or not) */
int MainInterface::getControlsVisibilityStatus()
{
+ msg_Warn( p_intf, "%i", (controls->isVisible() ? CONTROLS_VISIBLE : CONTROLS_HIDDEN )
+ + CONTROLS_ADVANCED * controls->b_advancedVisible );
return( (controls->isVisible() ? CONTROLS_VISIBLE : CONTROLS_HIDDEN )
+ CONTROLS_ADVANCED * controls->b_advancedVisible );
}
if( ( e->modifiers() & Qt::ControlModifier ) && ( e->key() == Qt::Key_H )
&& menuBar()->isHidden() )
{
- toggleMinimalView();
+ toggleMinimalView( false );
e->accept();
}
class QSize;
enum {
- CONTROLS_HIDDEN = 0x0,
CONTROLS_VISIBLE = 0x1,
- CONTROLS_ADVANCED = 0x2
+ CONTROLS_HIDDEN = 0x2,
+ CONTROLS_ADVANCED = 0x4,
};
typedef enum pl_dock_e {
public slots:
void undockPlaylist();
void dockPlaylist( pl_dock_e i_pos = PL_BOTTOM );
- void toggleMinimalView();
+ void toggleMinimalView( bool );
void togglePlaylist();
void toggleUpdateSystrayMenu();
void toggleAdvanced();
void askVideoToToggle();
void askBgWidgetToToggle();
void askUpdate();
+ void minimalViewToggled( bool );
};
#endif
/* HACK for minimalView to go around a Qt bug/feature
* that doesn't update the QAction checked state when QMenu is hidden */
-QAction *QVLCMenu::minimalViewAction = NULL;
QAction *QVLCMenu::fullscreenViewAction = NULL;
QMenu *QVLCMenu::recentsMenu = NULL;
}
/* Minimal View */
- QAction *action = menu->addAction( qtr( "Mi&nimal View" ), mi,
- SLOT( toggleMinimalView() ), qtr( "Ctrl+H" ) );
+ QAction *action = menu->addAction( qtr( "Mi&nimal View" ) );
+ action->setShortcut( qtr( "Ctrl+H" ) );
action->setCheckable( true );
+ action->setChecked( !with_intf &&
+ (mi->getControlsVisibilityStatus() && CONTROLS_HIDDEN ) );
- if( mi->getControlsVisibilityStatus() & CONTROLS_VISIBLE )
- action->setChecked( true );
- minimalViewAction = action; /* HACK for minimalView */
+ CONNECT( action, triggered( bool ), mi, toggleMinimalView( bool ) );
+ CONNECT( mi, minimalViewToggled( bool ), action, setChecked( bool ) );
/* FullScreen View */
action = menu->addAction( qtr( "&Fullscreen Interface" ), mi,