Commit 42aab545 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

Qt4: Fix docked playlist videoWidget bug

Fixes issue where docked playlist doesn't "release" its embedded videoWidget
Close #5588
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c1df0864
...@@ -548,6 +548,15 @@ inline void MainInterface::showTab( QWidget *widget ) ...@@ -548,6 +548,15 @@ inline void MainInterface::showTab( QWidget *widget )
videoWidget->show(); videoWidget->raise(); videoWidget->show(); videoWidget->raise();
stackCentralW->addWidget( videoWidget ); stackCentralW->addWidget( videoWidget );
} }
/* Embedded playlist -> Non-embedded playlist */
if( bgWidget == stackCentralOldWidget && widget == videoWidget )
{
playlistWidget->artContainer->removeWidget( videoWidget );
videoWidget->show(); videoWidget->raise();
stackCentralW->addWidget( videoWidget );
stackCentralW->setCurrentWidget( videoWidget );
}
} }
stackCentralW->setCurrentWidget( widget ); stackCentralW->setCurrentWidget( widget );
...@@ -803,6 +812,8 @@ void MainInterface::togglePlaylist() ...@@ -803,6 +812,8 @@ void MainInterface::togglePlaylist()
/* Playlist is not visible, show it */ /* Playlist is not visible, show it */
if( stackCentralW->currentWidget() != playlistWidget ) if( stackCentralW->currentWidget() != playlistWidget )
{ {
if( stackCentralW->indexOf( playlistWidget ) == -1 )
stackCentralW->addWidget( playlistWidget );
showTab( playlistWidget ); showTab( playlistWidget );
} }
else /* Hide it! */ else /* Hide it! */
...@@ -829,8 +840,10 @@ void MainInterface::dockPlaylist( bool p_docked ) ...@@ -829,8 +840,10 @@ void MainInterface::dockPlaylist( bool p_docked )
b_plDocked = p_docked; b_plDocked = p_docked;
if( !playlistWidget ) return; /* Playlist wasn't created yet */ if( !playlistWidget ) return; /* Playlist wasn't created yet */
if( !p_docked ) if( !p_docked ) /* Previously docked */
{ {
/* If playlist is invisible don't show it */
if( stackCentralW->currentWidget() != playlistWidget ) return;
stackCentralW->removeWidget( playlistWidget ); stackCentralW->removeWidget( playlistWidget );
#ifdef WIN32 #ifdef WIN32
playlistWidget->setParent( NULL ); playlistWidget->setParent( NULL );
...@@ -841,8 +854,11 @@ void MainInterface::dockPlaylist( bool p_docked ) ...@@ -841,8 +854,11 @@ void MainInterface::dockPlaylist( bool p_docked )
playlistWidget->show(); playlistWidget->show();
restoreStackOldWidget(); restoreStackOldWidget();
} }
else else /* Previously undocked */
{ {
/* If playlist is invisible don't show it */
if( !playlistWidget->isVisible() ) return;
QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget ); QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
playlistWidget->setWindowFlags( Qt::Widget ); // Probably a Qt bug here playlistWidget->setWindowFlags( Qt::Widget ); // Probably a Qt bug here
// It would be logical that QStackWidget::addWidget reset the flags... // It would be logical that QStackWidget::addWidget reset the flags...
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment