[vlc-devel] commit: Qt4: fix faulty playlist show / hide logic (Jakob Leben )

git version control git at videolan.org
Tue Nov 3 12:19:57 CET 2009


vlc | branch: master | Jakob Leben <jleben at videolan.org> | Tue Nov  3 12:15:03 2009 +0100| [0c3fb79a745ece13f640c28414fabab4631b0501] | committer: Jakob Leben 

Qt4: fix faulty playlist show / hide logic

Fixes #2899, at least on Linux. Can somebody test on Windows, please?

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

 modules/gui/qt4/components/playlist/playlist.cpp |    7 +++----
 modules/gui/qt4/main_interface.cpp               |   18 +++++++++++++++---
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist.cpp b/modules/gui/qt4/components/playlist/playlist.cpp
index 96d5012..bcef9ea 100644
--- a/modules/gui/qt4/components/playlist/playlist.cpp
+++ b/modules/gui/qt4/components/playlist/playlist.cpp
@@ -132,12 +132,11 @@ void PlaylistWidget::closeEvent( QCloseEvent *event )
     if( THEDP->isDying() )
     {
         /* FIXME is it needed ? */
-        close();
+        event->accept();
     }
     else
     {
-        if( p_intf->p_sys->p_mi )
-            p_intf->p_sys->p_mi->togglePlaylist();
+        hide();
+        event->ignore();
     }
-    event->accept();
 }
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 05359a0..40a8722 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -964,9 +964,21 @@ void MainInterface::togglePlaylist()
     else
     {
     /* toggle the visibility of the playlist */
-       TOGGLEV( playlistWidget );
-       playlistVisible = !playlistVisible;
-       //doComponentsUpdate(); //resize( sizeHint() );
+      //TOGGLEV( playlistWidget );
+
+      if( playlistWidget->isVisible() && !playlistWidget->isMinimized() )
+      {
+          playlistWidget->hide();
+      }
+      else
+      {
+          playlistWidget->setWindowState(
+              playlistWidget->windowState() & ~Qt::WindowMinimized | Qt::WindowActive);
+          playlistWidget->show();
+      }
+
+      playlistVisible = !playlistVisible;
+      //doComponentsUpdate(); //resize( sizeHint() );
     }
 }
 




More information about the vlc-devel mailing list