[vlc-commits] Qt: hide the resume panel without affecting the vout geometry (refs #12758 )

Ludovic Fauvet git at videolan.org
Mon Nov 24 18:15:05 CET 2014


vlc | branch: master | Ludovic Fauvet <etix at videolan.org> | Mon Nov 24 16:07:49 2014 +0100| [c7acc87279732139580b8f3f674babee5ef3c1c0] | committer: Ludovic Fauvet

Qt: hide the resume panel without affecting the vout geometry (refs #12758)

One corner case still remains when leaving the fullscreen since we
cannot resize the UI in this mode.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c7acc87279732139580b8f3f674babee5ef3c1c0
---

 modules/gui/qt4/main_interface.cpp |   16 +++++++++++++---
 modules/gui/qt4/main_interface.hpp |    1 +
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 35d1469..ddeb695 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -385,7 +385,7 @@ void MainInterface::createContinueDialog( QWidget *w )
     continueDialogLayout->addWidget( ok );
     continueDialogLayout->addWidget( cancel );
 
-    CONNECT( cancel, clicked(), continueDialog, hide() );
+    CONNECT( cancel, clicked(), this, hideContinueDialog() );
     BUTTONACT(ok, continuePlayback() );
 
     CONNECT( THEMIM->getIM(), continuePlayback(int64_t), this, showContinueDialog(int64_t) );
@@ -406,14 +406,24 @@ void MainInterface::showContinueDialog( int64_t _time ) {
     else
     {
         continueDialog->setVisible(true);
-        QTimer::singleShot(6000, continueDialog, SLOT(hide()));
+        QTimer::singleShot(6000, this, SLOT(hideContinueDialog()));
+    }
+}
+
+void MainInterface::hideContinueDialog()
+{
+    if( continueDialog->isVisible() )
+    {
+        if( !isFullScreen() && !isMaximized() )
+            resize( width(), height() - continueDialog->height() );
+        continueDialog->hide();
     }
 }
 
 void MainInterface::continuePlayback()
 {
     var_SetTime( THEMIM->getInput(), "time", i_continueTime );
-    continueDialog->hide();
+    hideContinueDialog();
 }
 
 void MainInterface::createMainWidget( QSettings *creationSettings )
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index ab4fca2..7af3fdf 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -259,6 +259,7 @@ private slots:
     void setRaise();
 
     void showContinueDialog( int64_t);
+    void hideContinueDialog();
     void continuePlayback();
 
 signals:



More information about the vlc-commits mailing list