b_autoresize = var_InheritBool( p_intf, "qt-video-autoresize" );
/* Are we in the enhanced always-video mode or not ? */
- i_visualmode = var_InheritInteger( p_intf, "qt-minimal-view" );
+ b_minimalView = var_InheritBool( p_intf, "qt-minimal-view" );
/* Do we want anoying popups or not */
b_notificationEnabled = var_InheritBool( p_intf, "qt-notification" );
}
CONNECT( this, askVideoSetFullScreen( bool ),
this, setVideoFullScreen( bool ) );
- CONNECT( videoWidget, keyPressed( QKeyEvent * ),
- this, handleKeyPress( QKeyEvent * ) );
}
CONNECT( THEDP, toolBarConfUpdated(), this, recreateToolbars() );
QVLCTools::restoreWidgetPosition( settings, this, QSize(400, 100) );
settings->endGroup();
+ b_interfaceFullScreen = isFullScreen();
+
/* Final sizing and showing */
setVisible( !b_hideAfterCreation );
menuBar()->sizeHint().width() ) + 30 );
/* Switch to minimal view if needed, must be called after the show() */
- if( i_visualmode )
+ if( b_minimalView )
toggleMinimalView( true );
}
{
videoWidget->release();
setVideoOnTop( false );
+ setVideoFullScreen( false );
if( stackCentralW->currentWidget() == videoWidget )
restoreStackOldWidget();
void MainInterface::setVideoSize( unsigned int w, unsigned int h )
{
- if( isFullScreen() || isMaximized() )
- showNormal();
- videoWidget->SetSizing( w, h );
+ if( !isFullScreen() && !isMaximized() )
+ videoWidget->SetSizing( w, h );
}
void MainInterface::setVideoFullScreen( bool fs )
{
b_videoFullScreen = fs;
- /* refresh main interface on-top status if needed */
- setVideoOnTop( b_videoOnTop );
- videoWidget->SetFullScreen( fs, b_videoOnTop );
+ if( fs )
+ {
+ int numscreen = var_InheritInteger( p_intf, "qt-fullscreen-screennumber" );
+ /* if user hasn't defined screennumber, or screennumber that is bigger
+ * than current number of screens, take screennumber where current interface
+ * is
+ */
+ if( numscreen == -1 || numscreen > QApplication::desktop()->numScreens() )
+ numscreen = QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
+
+ QRect screenres = QApplication::desktop()->screenGeometry( numscreen );
+
+ /* To be sure window is on proper-screen in xinerama */
+ if( !screenres.contains( pos() ) )
+ {
+ msg_Dbg( p_intf, "Moving video to correct screen");
+ move( QPoint( screenres.x(), screenres.y() ) );
+ }
+ setMinimalView( true );
+ setInterfaceFullScreen( true );
+ }
+ else
+ {
+ /* TODO do we want to restore screen and position ? (when
+ * qt-fullscreen-screennumber is forced) */
+ setMinimalView( b_minimalView );
+ setInterfaceFullScreen( b_interfaceFullScreen );
+ }
+ videoWidget->sync();
}
/* Slot to change the video always-on-top flag.
void MainInterface::setVideoOnTop( bool on_top )
{
b_videoOnTop = on_top;
- /* The main interface is not always-on-top if it does not contain
- * the video (which is to say in fullscreen mode). */
- if( b_videoFullScreen )
- on_top = false;
Qt::WindowFlags oldflags = windowFlags(), newflags;
- if( on_top )
+ if( b_videoOnTop )
newflags = oldflags | Qt::WindowStaysOnTopHint;
else
newflags = oldflags & ~Qt::WindowStaysOnTopHint;
playlistVisible = true;
}
+void MainInterface::setMinimalView( bool b_minimal )
+{
+ menuBar()->setVisible( !b_minimal );
+ controls->setVisible( !b_minimal );
+ statusBar()->setVisible( !b_minimal );
+ inputC->setVisible( !b_minimal );
+}
+
/*
- If b_switch is false, then we are normalView
+ If b_minimal is false, then we are normalView
*/
-void MainInterface::toggleMinimalView( bool b_switch )
+void MainInterface::toggleMinimalView( bool b_minimal )
{
- if( i_visualmode == 0 && b_autoresize ) /* Normal mode */
+ if( !b_minimalView && b_autoresize ) /* Normal mode */
{
if( stackCentralW->currentWidget() == bgWidget )
{
}
}
}
+ b_minimalView = b_minimal;
+ if( !b_videoFullScreen )
+ setMinimalView( b_minimalView );
- menuBar()->setVisible( !b_switch );
- controls->setVisible( !b_switch );
- statusBar()->setVisible( !b_switch );
- inputC->setVisible( !b_switch );
-
- emit minimalViewToggled( b_switch );
+ emit minimalViewToggled( b_minimalView );
}
/* toggling advanced controls buttons */
void MainInterface::handleKeyPress( QKeyEvent *e )
{
- if( ( e->modifiers() & Qt::ControlModifier ) && ( e->key() == Qt::Key_H )
- && !menuBar()->isVisible() )
+ if( ( e->modifiers() & Qt::ControlModifier ) && ( e->key() == Qt::Key_H ) )
{
- toggleMinimalView( false );
+ toggleMinimalView( !b_minimalView );
e->accept();
}
THEDP->quit();
}
-void MainInterface::toggleFullScreen()
+void MainInterface::setInterfaceFullScreen( bool fs )
{
- if( isFullScreen() )
- {
- showNormal();
- emit fullscreenInterfaceToggled( false );
- }
- else
- {
+ if( fs )
showFullScreen();
- emit fullscreenInterfaceToggled( true );
- }
+ else
+ showNormal();
+}
+void MainInterface::toggleInterfaceFullScreen()
+{
+ b_interfaceFullScreen = !b_interfaceFullScreen;
+ if( !b_videoFullScreen )
+ setInterfaceFullScreen( b_interfaceFullScreen );
+ emit fullscreenInterfaceToggled( b_interfaceFullScreen );
}
/*****************************************************************************