Commit f10e4010 authored by Benjamin's avatar Benjamin Committed by Ilkka Ollakka

The default constructor of QSize produce an invalid size, there is no need to do that manually.

The widget is hidden by default, no need to call hide in the
constructor.

The widget reparentable already has the layout.
Signed-off-by: default avatarIlkka Ollakka <ileoo@videolan.org>
parent 4b1160c8
...@@ -80,15 +80,11 @@ protected: ...@@ -80,15 +80,11 @@ protected:
* This class handles resize issues * This class handles resize issues
**********************************************************************/ **********************************************************************/
VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i ) VideoWidget::VideoWidget( intf_thread_t *_p_i )
: QFrame( NULL )
, p_intf( _p_i )
, reparentable( NULL )
{ {
/* Init */
reparentable = NULL;
videoSize.rwidth() = -1;
videoSize.rheight() = -1;
hide();
/* Set the policy to expand in both directions */ /* Set the policy to expand in both directions */
// setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); // setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
...@@ -147,7 +143,6 @@ WId VideoWidget::request( int *pi_x, int *pi_y, ...@@ -147,7 +143,6 @@ WId VideoWidget::request( int *pi_x, int *pi_y,
innerLayout->addWidget( stable ); innerLayout->addWidget( stable );
reparentable->setLayout( innerLayout );
layout->addWidget( reparentable ); layout->addWidget( reparentable );
#ifdef Q_WS_X11 #ifdef Q_WS_X11
...@@ -178,8 +173,8 @@ void VideoWidget::SetSizing( unsigned int w, unsigned int h ) ...@@ -178,8 +173,8 @@ void VideoWidget::SetSizing( unsigned int w, unsigned int h )
if (reparentable->windowState() & Qt::WindowFullScreen ) if (reparentable->windowState() & Qt::WindowFullScreen )
return; return;
msg_Dbg( p_intf, "Video is resizing to: %i %i", w, h ); msg_Dbg( p_intf, "Video is resizing to: %i %i", w, h );
videoSize.rwidth() = w; videoSize.setWidth( w );
videoSize.rheight() = h; videoSize.setHeight( h );
if( !isVisible() ) show(); if( !isVisible() ) show();
updateGeometry(); // Needed for deinterlace updateGeometry(); // Needed for deinterlace
videoSync(); videoSync();
...@@ -271,8 +266,7 @@ void VideoWidget::release( void ) ...@@ -271,8 +266,7 @@ void VideoWidget::release( void )
delete reparentable; delete reparentable;
reparentable = NULL; reparentable = NULL;
videoSize.rwidth() = 0; videoSize = QSize();
videoSize.rheight() = 0;
updateGeometry(); updateGeometry();
hide(); hide();
} }
......
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