Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[gui][editor widgets] Fix height of video frame going to zero after o…
…ne successful playback
  • Loading branch information
nirvn authored and nyalldawson committed Apr 5, 2023
1 parent fc2293d commit 0e419a3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/gui/qgsmediawidget.cpp
Expand Up @@ -32,9 +32,9 @@ QgsMediaWidget::QgsMediaWidget( QWidget *parent )
mLayout->setContentsMargins( 0, 0, 0, 0 );

mVideoWidget = new QVideoWidget( this );
mVideoWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
mVideoWidget->setMinimumHeight( 0 );
mVideoWidget->setMaximumHeight( 9999 );
const int vHeight = QFontMetrics( font() ).height() * 12;
mVideoWidget->setMinimumHeight( vHeight );
mVideoWidget->setMaximumHeight( vHeight );
mLayout->addWidget( mVideoWidget );

QHBoxLayout *controlsLayout = new QHBoxLayout();
Expand Down Expand Up @@ -126,8 +126,9 @@ int QgsMediaWidget::videoHeight() const

void QgsMediaWidget::setVideoHeight( int height )
{
mVideoWidget->setMinimumHeight( height );
mVideoWidget->setMaximumHeight( height > 0 ? height : 9999 );
const int vHeight = height > 0 ? height : QFontMetrics( font() ).height() * 12;
mVideoWidget->setMinimumHeight( vHeight );
mVideoWidget->setMaximumHeight( vHeight );
}

void QgsMediaWidget::adjustControls()
Expand Down

0 comments on commit 0e419a3

Please sign in to comment.