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

Qt: fullscreen controller first position.

Close #2283.
parent bce50f87
...@@ -714,7 +714,23 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i ) ...@@ -714,7 +714,23 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i )
vlc_mutex_init_recursive( &lock ); vlc_mutex_init_recursive( &lock );
CONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ), this, setVoutList( vout_thread_t **, int ) ); CONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ),
this, setVoutList( vout_thread_t **, int ) );
/* First Move */
QPoint pos1 = getSettings()->value( "FullScreen/pos" ).toPoint();
int number = QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
if( QApplication::desktop()->screenGeometry( number ).contains( pos1, true ) )
{
move( pos1 );
i_screennumber = number;
screenRes = QApplication::desktop()->screenGeometry(number);
}
else
{
centerFSC( number );
}
} }
FullscreenControllerWidget::~FullscreenControllerWidget() FullscreenControllerWidget::~FullscreenControllerWidget()
...@@ -724,24 +740,29 @@ FullscreenControllerWidget::~FullscreenControllerWidget() ...@@ -724,24 +740,29 @@ FullscreenControllerWidget::~FullscreenControllerWidget()
vlc_mutex_destroy( &lock ); vlc_mutex_destroy( &lock );
} }
void FullscreenControllerWidget::centerFSC( int number )
{
screenRes = QApplication::desktop()->screenGeometry(number);
/* screen has changed, calculate new position */
QPoint pos = QPoint( screenRes.x() + (screenRes.width() / 2) - (width() / 2),
screenRes.y() + screenRes.height() - height());
move( pos );
i_screennumber = number;
}
/** /**
* Show fullscreen controller * Show fullscreen controller
*/ */
void FullscreenControllerWidget::showFSC() void FullscreenControllerWidget::showFSC()
{ {
adjustSize(); adjustSize();
/* center down */
int number = QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi ); int number = QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
if( number != i_screennumber || if( number != i_screennumber ||
screenRes != QApplication::desktop()->screenGeometry(number) ) screenRes != QApplication::desktop()->screenGeometry(number) )
{ {
screenRes = QApplication::desktop()->screenGeometry(number); centerFSC( number );
msg_Dbg( p_intf, "Calculation fullscreen controllers center");
/* screen has changed, calculate new position */
QPoint pos = QPoint( screenRes.x() + (screenRes.width() / 2) - (width() / 2),
screenRes.y() + screenRes.height() - height());
move( pos );
i_screennumber = number;
} }
#ifdef WIN32TRICK #ifdef WIN32TRICK
// after quiting and going to fs, we need to call show() // after quiting and going to fs, we need to call show()
......
...@@ -253,6 +253,7 @@ private slots: ...@@ -253,6 +253,7 @@ private slots:
void planHideFSC(); void planHideFSC();
void hideFSC(); void hideFSC();
void slowHideFSC(); void slowHideFSC();
void centerFSC( int );
private: private:
virtual void customEvent( QEvent *event ); virtual void customEvent( QEvent *event );
......
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