]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/main_interface.cpp
Implement dock/undock for the playlist
[vlc] / modules / gui / qt4 / main_interface.cpp
index e3ff231d2b67292169be46ab8717461ed8cdd936..67d54c3d0660d7f08fdc5f9d516798676643d2c0 100644 (file)
@@ -375,8 +375,7 @@ void MainInterface::visual()
         /* Stop any currently running visualization */
         visualSelector->hide();
     }
-    calculateInterfaceSize();
-    resize( mainSize );
+    doComponentsUpdate();
 }
 
 void MainInterface::playlist()
@@ -426,9 +425,7 @@ void MainInterface::playlist()
         }
         if( VISIBLE( bgWidget ) ) bgWidget->hide();
     }
-
-    calculateInterfaceSize();
-    resize( mainSize );
+    doComponentsUpdate();
 }
 
 /* Video widget cannot do this synchronously as it runs in another thread */
@@ -439,6 +436,23 @@ void MainInterface::doComponentsUpdate()
     resize( mainSize );
 }
 
+void MainInterface::customEvent( QEvent *event )
+{
+    if( event->type() == PLUndockEvent_Type )
+    {
+        ui.vboxLayout->removeWidget( playlistWidget );
+        playlistWidget = NULL;
+        playlistEmbeddedFlag = false;
+        doComponentsUpdate();
+    }
+    else if( event->type() == PLDockEvent_Type )
+    {
+        PlaylistDialog::killInstance();
+        playlistEmbeddedFlag = true;
+        playlist();
+    }
+}
+
 /************************************************************************
  * Other stuff
  ************************************************************************/