vlc | branch: master | Benoit du Payrat <[email protected]> | Mon Jul 4 16:12:07 2016 +0200| [7e9d58705c550af692faa646751094a6ae0beaf5] | committer: Jean-Baptiste Kempf
Qt: videos can no longer be larger than the screen If an attempt is made to resize the video widget to a size larger than the screen, it will be resized to a sensible size, filling the screen instead. Close #12852 Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7e9d58705c550af692faa646751094a6ae0beaf5 --- modules/gui/qt/main_interface.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp index b4bf2be..60800b4 100644 --- a/modules/gui/qt/main_interface.cpp +++ b/modules/gui/qt/main_interface.cpp @@ -784,9 +784,33 @@ void MainInterface::setVideoSize( unsigned int w, unsigned int h ) /* Resize video widget to video size, or keep it at the same * size. Call setSize() either way so that vout_window_ReportSize * will always get called. + * If the video size is too large for the screen, resize it + * to the screen size. */ if (b_autoresize) + { + QRect screen = QApplication::desktop()->availableGeometry(); + if( h > screen.height() ) + { + w = screen.width(); + h = screen.height(); + if( !b_minimalView ) + { + if( menuBar()->isVisible() ) + h -= menuBar()->height(); + if( controls->isVisible() ) + h -= controls->height(); + if( statusBar()->isVisible() ) + h -= statusBar()->height(); + if( inputC->isVisible() ) + h -= inputC->height(); + } + h -= style()->pixelMetric(QStyle::PM_TitleBarHeight); + h -= style()->pixelMetric(QStyle::PM_LayoutBottomMargin); + h -= 2 * style()->pixelMetric(QStyle::PM_DefaultFrameWidth); + } videoWidget->setSize( w, h ); + } else videoWidget->setSize( videoWidget->width(), videoWidget->height() ); } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
