Commit 6fa897af authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

bgWidget fix. Close #1743

parent 2e812d10
...@@ -416,18 +416,21 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -416,18 +416,21 @@ void MainInterface::handleMainUi( QSettings *settings )
visualSelector->hide(); visualSelector->hide();
#endif #endif
/* And video Outputs */ /* Bg Cone */
if( i_visualmode == QT_ALWAYS_VIDEO_MODE ||
i_visualmode == QT_MINIMAL_MODE )
{
bgWidget = new BackgroundWidget( p_intf ); bgWidget = new BackgroundWidget( p_intf );
bgWidget->resize( bgWidget->resize(
settings->value( "backgroundSize", QSize( 300, 150 ) ).toSize() ); settings->value( "backgroundSize", QSize( 300, 200 ) ).toSize() );
bgWidget->updateGeometry(); bgWidget->updateGeometry();
mainLayout->insertWidget( 0, bgWidget ); mainLayout->insertWidget( 0, bgWidget );
CONNECT( this, askBgWidgetToToggle(), bgWidget, toggle() ); CONNECT( this, askBgWidgetToToggle(), bgWidget, toggle() );
if( i_visualmode != QT_ALWAYS_VIDEO_MODE &&
i_visualmode != QT_MINIMAL_MODE )
{
bgWidget->hide();
} }
/* And video Outputs */
if( videoEmbeddedFlag ) if( videoEmbeddedFlag )
{ {
videoWidget = new VideoWidget( p_intf ); videoWidget = new VideoWidget( p_intf );
...@@ -652,7 +655,7 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x, ...@@ -652,7 +655,7 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
int *pi_y, unsigned int *pi_width, int *pi_y, unsigned int *pi_width,
unsigned int *pi_height ) unsigned int *pi_height )
{ {
bool bgWasVisible = false; bgWasVisible = false;
/* Request the videoWidget */ /* Request the videoWidget */
void *ret = videoWidget->request( p_nvout,pi_x, pi_y, pi_width, pi_height ); void *ret = videoWidget->request( p_nvout,pi_x, pi_y, pi_width, pi_height );
...@@ -698,8 +701,11 @@ void MainInterface::releaseVideoSlot( void *p_win ) ...@@ -698,8 +701,11 @@ void MainInterface::releaseVideoSlot( void *p_win )
videoWidget->release( p_win ); videoWidget->release( p_win );
videoWidget->hide(); videoWidget->hide();
if( bgWidget )// WRONG if( bgWasVisible )
{
bgWasVisible = false;
bgWidget->show(); bgWidget->show();
}
adjustSize(); adjustSize();
videoIsActive = false; videoIsActive = false;
...@@ -801,6 +807,12 @@ void MainInterface::toggleMinimalView() ...@@ -801,6 +807,12 @@ void MainInterface::toggleMinimalView()
{ {
/* HACK for minimalView, see menus.cpp */ /* HACK for minimalView, see menus.cpp */
if( !menuBar()->isVisible() ) QVLCMenu::minimalViewAction->toggle(); if( !menuBar()->isVisible() ) QVLCMenu::minimalViewAction->toggle();
if( i_visualmode != QT_ALWAYS_VIDEO_MODE &&
i_visualmode != QT_MINIMAL_MODE )
{
emit askBgWidgetToToggle();
}
TOGGLEV( menuBar() ); TOGGLEV( menuBar() );
TOGGLEV( controls ); TOGGLEV( controls );
TOGGLEV( statusBar() ); TOGGLEV( statusBar() );
......
...@@ -131,7 +131,8 @@ private: ...@@ -131,7 +131,8 @@ private:
bool playlistVisible; ///< Is the playlist visible ? bool playlistVisible; ///< Is the playlist visible ?
bool visualSelectorEnabled; bool visualSelectorEnabled;
bool notificationEnabled; /// Systray Notifications bool notificationEnabled; /// Systray Notifications
bool b_remainingTime; /* showing elapsed or remaining time */ bool b_remainingTime; /* Show elapsed or remaining time */
bool bgWasVisible;
int i_visualmode; ///< Visual Mode int i_visualmode; ///< Visual Mode
input_thread_t *p_input; ///< Main input associated to the playlist input_thread_t *p_input; ///< Main input associated to the playlist
......
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