[vlc-devel] commit: bgWidget fix. Close #1743 (Jean-Baptiste Kempf )
git version control
git at videolan.org
Wed Jul 30 08:23:03 CEST 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Jul 29 23:25:14 2008 -0700| [6fa897afdd9799155c76e3fd4812e5304a51d766]
bgWidget fix. Close #1743
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6fa897afdd9799155c76e3fd4812e5304a51d766
---
modules/gui/qt4/main_interface.cpp | 34 +++++++++++++++++++++++-----------
modules/gui/qt4/main_interface.hpp | 3 ++-
2 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 70faab2..0641b25 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -416,18 +416,21 @@ void MainInterface::handleMainUi( QSettings *settings )
visualSelector->hide();
#endif
- /* And video Outputs */
- if( i_visualmode == QT_ALWAYS_VIDEO_MODE ||
- i_visualmode == QT_MINIMAL_MODE )
+ /* Bg Cone */
+ bgWidget = new BackgroundWidget( p_intf );
+ bgWidget->resize(
+ settings->value( "backgroundSize", QSize( 300, 200 ) ).toSize() );
+ bgWidget->updateGeometry();
+ mainLayout->insertWidget( 0, bgWidget );
+ CONNECT( this, askBgWidgetToToggle(), bgWidget, toggle() );
+
+ if( i_visualmode != QT_ALWAYS_VIDEO_MODE &&
+ i_visualmode != QT_MINIMAL_MODE )
{
- bgWidget = new BackgroundWidget( p_intf );
- bgWidget->resize(
- settings->value( "backgroundSize", QSize( 300, 150 ) ).toSize() );
- bgWidget->updateGeometry();
- mainLayout->insertWidget( 0, bgWidget );
- CONNECT( this, askBgWidgetToToggle(), bgWidget, toggle() );
+ bgWidget->hide();
}
+ /* And video Outputs */
if( videoEmbeddedFlag )
{
videoWidget = new VideoWidget( p_intf );
@@ -652,7 +655,7 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
int *pi_y, unsigned int *pi_width,
unsigned int *pi_height )
{
- bool bgWasVisible = false;
+ bgWasVisible = false;
/* Request the videoWidget */
void *ret = videoWidget->request( p_nvout,pi_x, pi_y, pi_width, pi_height );
@@ -698,8 +701,11 @@ void MainInterface::releaseVideoSlot( void *p_win )
videoWidget->release( p_win );
videoWidget->hide();
- if( bgWidget )// WRONG
+ if( bgWasVisible )
+ {
+ bgWasVisible = false;
bgWidget->show();
+ }
adjustSize();
videoIsActive = false;
@@ -801,6 +807,12 @@ void MainInterface::toggleMinimalView()
{
/* HACK for minimalView, see menus.cpp */
if( !menuBar()->isVisible() ) QVLCMenu::minimalViewAction->toggle();
+ if( i_visualmode != QT_ALWAYS_VIDEO_MODE &&
+ i_visualmode != QT_MINIMAL_MODE )
+ {
+ emit askBgWidgetToToggle();
+ }
+
TOGGLEV( menuBar() );
TOGGLEV( controls );
TOGGLEV( statusBar() );
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index fe44a46..b4d25f3 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -131,7 +131,8 @@ private:
bool playlistVisible; ///< Is the playlist visible ?
bool visualSelectorEnabled;
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
input_thread_t *p_input; ///< Main input associated to the playlist
More information about the vlc-devel
mailing list