[vlc-devel] [PATCH 2/2] Qt: Hide playlist widget on minimizing the main interface
Mario Speiß
1034-135 at online.de
Wed Jun 13 21:59:01 CEST 2012
Hide the playlist if main interface is minimized automatically.
Change in components/playlist/playlist.cpp is to comply with the picflow view.
---
modules/gui/qt4/components/playlist/playlist.cpp | 4 ----
modules/gui/qt4/dialogs/playlist.cpp | 8 ++++++++
modules/gui/qt4/main_interface.cpp | 1 +
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist.cpp b/modules/gui/qt4/components/playlist/playlist.cpp
index 29d402d..919fe95 100644
--- a/modules/gui/qt4/components/playlist/playlist.cpp
+++ b/modules/gui/qt4/components/playlist/playlist.cpp
@@ -126,11 +126,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
QActionGroup *actionGroup = new QActionGroup( this );
-#ifndef NDEBUG
# define MAX_VIEW StandardPLPanel::VIEW_COUNT
-#else
-# define MAX_VIEW StandardPLPanel::VIEW_COUNT - 1
-#endif
for( int i = 0; i < MAX_VIEW; i++ )
{
viewActions[i] = actionGroup->addAction( viewNames[i] );
diff --git a/modules/gui/qt4/dialogs/playlist.cpp b/modules/gui/qt4/dialogs/playlist.cpp
index 646fd53..4da7072 100644
--- a/modules/gui/qt4/dialogs/playlist.cpp
+++ b/modules/gui/qt4/dialogs/playlist.cpp
@@ -36,6 +36,14 @@
PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf )
: QVLCMW( _p_intf )
{
+ /* support hiding the playlist if the mi is minimized */
+ setParent( (QWidget*)_p_intf->p_sys->p_mi );
+#ifdef __APPLE__
+ setWindowFlags( Qt::Drawer );
+#else /* use tool style instead */
+ setWindowFlags( Qt::Tool );
+#endif
+
setWindowTitle( qtr( "Playlist" ) );
setWindowRole( "vlc-playlist" );
setWindowOpacity( var_InheritFloat( p_intf, "qt-opacity" ) );
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index c02aca5..62fce67 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -288,6 +288,7 @@ MainInterface::~MainInterface()
/* Save playlist state */
settings->setValue( "playlist-visible", playlistVisible );
+ PlaylistDialog::killInstance();
settings->setValue( "adv-controls",
getControlsVisibilityStatus() & CONTROLS_ADVANCED );
--
1.7.5.4
More information about the vlc-devel
mailing list