Commit 29b82ab8 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.
parent e67328f2
...@@ -1025,6 +1025,7 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, ...@@ -1025,6 +1025,7 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i,
i_mouse_last_move_y = -1; i_mouse_last_move_y = -1;
setWindowFlags( Qt::ToolTip ); setWindowFlags( Qt::ToolTip );
setMinimumWidth( 600 );
setFrameShape( QFrame::StyledPanel ); setFrameShape( QFrame::StyledPanel );
setFrameStyle( QFrame::Sunken ); setFrameStyle( QFrame::Sunken );
...@@ -1070,11 +1071,16 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, ...@@ -1070,11 +1071,16 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i,
adjustSize (); /* need to get real width and height for moving */ adjustSize (); /* need to get real width and height for moving */
/* center down */ /* 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() ); p_desktop->height() - height() );
getSettings()->beginGroup( "FullScreen" );
move( getSettings()->value( "pos", pos ).toPoint() );
getSettings()->endGroup();
#ifdef WIN32TRICK #ifdef WIN32TRICK
setWindowOpacity( 0.0 ); setWindowOpacity( 0.0 );
b_fscHidden = true; b_fscHidden = true;
...@@ -1085,11 +1091,13 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, ...@@ -1085,11 +1091,13 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i,
fullscreenButton->setIcon( QIcon( ":/defullscreen" ) ); fullscreenButton->setIcon( QIcon( ":/defullscreen" ) );
vlc_mutex_init_recursive( &lock ); vlc_mutex_init_recursive( &lock );
setMinimumWidth( 600 );
} }
FullscreenControllerWidget::~FullscreenControllerWidget() FullscreenControllerWidget::~FullscreenControllerWidget()
{ {
getSettings()->beginGroup( "FullScreen" );
getSettings()->setValue( "pos", pos() );
getSettings()->endGroup();
detachVout(); detachVout();
vlc_mutex_destroy( &lock ); vlc_mutex_destroy( &lock );
} }
......
...@@ -213,9 +213,9 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -213,9 +213,9 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
CONNECT( this, askUpdate(), this, doComponentsUpdate() ); CONNECT( this, askUpdate(), this, doComponentsUpdate() );
/* Size and placement of interface */ /* Size and placement of interface */
settings->beginGroup( "MainWindow" );
QVLCTools::restoreWidgetPosition( settings, this, QSize(380, 60) ); QVLCTools::restoreWidgetPosition( settings, this, QSize(380, 60) );
bool b_visible = settings->value( "playlist-visible", 0 ).toInt(); bool b_visible = settings->value( "playlist-visible", 0 ).toInt();
settings->endGroup(); settings->endGroup();
...@@ -387,19 +387,6 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -387,19 +387,6 @@ void MainInterface::handleMainUi( QSettings *settings )
CONNECT( controls, advancedControlsToggled( bool ), CONNECT( controls, advancedControlsToggled( bool ),
this, doComponentsUpdate() ); 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 */ /* Add the controls Widget to the main Widget */
mainLayout->insertWidget( 0, controls, 0, Qt::AlignBottom ); mainLayout->insertWidget( 0, controls, 0, Qt::AlignBottom );
...@@ -442,6 +429,20 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -442,6 +429,20 @@ void MainInterface::handleMainUi( QSettings *settings )
/* Finish the sizing */ /* Finish the sizing */
main->updateGeometry(); 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() 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