Commit b069b028 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4: Center the Fullscreen controller on One screen, and remember pos.

Well, of course, X11/DirectX being so easy, there are n-1/n changes of being on the wrong screen (if you have n screen).
But at least, you can move and it will remember the position.
(cherry picked from commit 29b82ab8d1fb740b4be0d6a0d142a107ffe7be19)
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 936a35d9
......@@ -1012,6 +1012,7 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i,
i_mouse_last_move_y = -1;
setWindowFlags( Qt::ToolTip );
setMinimumWidth( 600 );
setFrameShape( QFrame::StyledPanel );
setFrameStyle( QFrame::Sunken );
......@@ -1057,11 +1058,16 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i,
adjustSize (); /* need to get real width and height for moving */
/* center down */
QDesktopWidget * p_desktop = QApplication::desktop();
QWidget * p_desktop = QApplication::desktop()->screen(
QApplication::desktop()->screenNumber( _p_mi ) );
move( p_desktop->width() / 2 - width() / 2,
QPoint pos = QPoint( p_desktop->width() / 2 - width() / 2,
p_desktop->height() - height() );
getSettings()->beginGroup( "FullScreen" );
move( getSettings()->value( "pos", pos ).toPoint() );
getSettings()->endGroup();
#ifdef WIN32TRICK
setWindowOpacity( 0.0 );
b_fscHidden = true;
......@@ -1072,11 +1078,13 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i,
fullscreenButton->setIcon( QIcon( ":/defullscreen" ) );
vlc_mutex_init_recursive( &lock );
setMinimumWidth( 600 );
}
FullscreenControllerWidget::~FullscreenControllerWidget()
{
getSettings()->beginGroup( "FullScreen" );
getSettings()->setValue( "pos", pos() );
getSettings()->endGroup();
detachVout();
vlc_mutex_destroy( &lock );
}
......
......@@ -213,9 +213,9 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
CONNECT( this, askUpdate(), this, doComponentsUpdate() );
/* Size and placement of interface */
settings->beginGroup( "MainWindow" );
QVLCTools::restoreWidgetPosition( settings, this, QSize(380, 60) );
bool b_visible = settings->value( "playlist-visible", 0 ).toInt();
settings->endGroup();
......@@ -378,19 +378,6 @@ void MainInterface::handleMainUi( QSettings *settings )
CONNECT( controls, advancedControlsToggled( bool ),
this, doComponentsUpdate() );
#ifdef WIN32
if ( depth() > 8 )
#endif
/* Create the FULLSCREEN CONTROLS Widget */
if( config_GetInt( p_intf, "qt-fs-controller" ) )
{
fullscreenControls = new FullscreenControllerWidget( p_intf, this,
settings->value( "adv-controls", false ).toBool(),
b_shiny );
CONNECT( fullscreenControls, advancedControlsToggled( bool ),
this, doComponentsUpdate() );
}
/* Add the controls Widget to the main Widget */
mainLayout->insertWidget( 0, controls, 0, Qt::AlignBottom );
......@@ -433,6 +420,20 @@ void MainInterface::handleMainUi( QSettings *settings )
/* Finish the sizing */
main->updateGeometry();
getSettings()->endGroup();
#ifdef WIN32
if ( depth() > 8 )
#endif
/* Create the FULLSCREEN CONTROLS Widget */
if( config_GetInt( p_intf, "qt-fs-controller" ) )
{
fullscreenControls = new FullscreenControllerWidget( p_intf, this,
settings->value( "adv-controls", false ).toBool(),
b_shiny );
CONNECT( fullscreenControls, advancedControlsToggled( bool ),
this, doComponentsUpdate() );
}
}
inline void MainInterface::askForPrivacy()
......
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