Commit dccb47b8 authored by Cyril Deguet's avatar Cyril Deguet

* all: the "visible" attribute for windows (in the XML) now

  does what it should (if set to "false", the window is hidden
  when the theme is loaded for the first time)
parent 272e3bf9
...@@ -187,7 +187,8 @@ void Builder::addWindow( const BuilderData::Window &rData ) ...@@ -187,7 +187,8 @@ void Builder::addWindow( const BuilderData::Window &rData )
TopWindow *pWin = TopWindow *pWin =
new TopWindow( getIntf(), rData.m_xPos, rData.m_yPos, new TopWindow( getIntf(), rData.m_xPos, rData.m_yPos,
m_pTheme->getWindowManager(), m_pTheme->getWindowManager(),
rData.m_dragDrop, rData.m_playOnDrop ); rData.m_dragDrop, rData.m_playOnDrop,
rData.m_visible );
m_pTheme->m_windows[rData.m_id] = TopWindowPtr( pWin ); m_pTheme->m_windows[rData.m_id] = TopWindowPtr( pWin );
} }
......
...@@ -51,7 +51,7 @@ void Theme::loadConfig() ...@@ -51,7 +51,7 @@ void Theme::loadConfig()
if( !strcmp( save, "" ) ) if( !strcmp( save, "" ) )
{ {
// Show the windows // Show the windows
m_windowManager.showAll(); m_windowManager.showAll( true );
return; return;
} }
......
...@@ -98,7 +98,7 @@ bool ThemeLoader::load( const string &fileName ) ...@@ -98,7 +98,7 @@ bool ThemeLoader::load( const string &fileName )
{ {
config_PutPsz( getIntf(), "skins2-last", fileName.c_str() ); config_PutPsz( getIntf(), "skins2-last", fileName.c_str() );
// Show the windows // Show the windows
pNewTheme->getWindowManager().showAll(); pNewTheme->getWindowManager().showAll( true );
} }
if( skin_last ) free( skin_last ); if( skin_last ) free( skin_last );
......
...@@ -49,12 +49,11 @@ ...@@ -49,12 +49,11 @@
TopWindow::TopWindow( intf_thread_t *pIntf, int left, int top, TopWindow::TopWindow( intf_thread_t *pIntf, int left, int top,
WindowManager &rWindowManager, WindowManager &rWindowManager,
bool dragDrop, bool playOnDrop ): bool dragDrop, bool playOnDrop, bool visible ):
GenericWindow( pIntf, left, top, dragDrop, playOnDrop, GenericWindow( pIntf, left, top, dragDrop, playOnDrop, NULL ),
NULL), m_visible( visible ), m_rWindowManager( rWindowManager ),
m_rWindowManager( rWindowManager ), m_pActiveLayout( NULL ), m_pActiveLayout( NULL ), m_pLastHitControl( NULL ),
m_pLastHitControl( NULL ), m_pCapturingControl( NULL ), m_pCapturingControl( NULL ), m_pFocusControl( NULL ), m_currModifier( 0 )
m_pFocusControl( NULL ), m_currModifier( 0 )
{ {
// Register as a moving window // Register as a moving window
m_rWindowManager.registerWindow( *this ); m_rWindowManager.registerWindow( *this );
......
...@@ -44,7 +44,7 @@ class TopWindow: public GenericWindow ...@@ -44,7 +44,7 @@ class TopWindow: public GenericWindow
public: public:
TopWindow( intf_thread_t *pIntf, int xPos, int yPos, TopWindow( intf_thread_t *pIntf, int xPos, int yPos,
WindowManager &rWindowManager, WindowManager &rWindowManager,
bool dragDrop, bool playOnDrop ); bool dragDrop, bool playOnDrop, bool visible );
virtual ~TopWindow(); virtual ~TopWindow();
/// Methods to process OS events. /// Methods to process OS events.
...@@ -77,6 +77,9 @@ class TopWindow: public GenericWindow ...@@ -77,6 +77,9 @@ class TopWindow: public GenericWindow
/// Called by a control when its tooltip changed /// Called by a control when its tooltip changed
virtual void onTooltipChange( const CtrlGeneric &rCtrl ); virtual void onTooltipChange( const CtrlGeneric &rCtrl );
/// Get the initial visibility status
bool isVisible() const { return m_visible; }
protected: protected:
/// Actually show the window /// Actually show the window
virtual void innerShow(); virtual void innerShow();
...@@ -85,6 +88,8 @@ class TopWindow: public GenericWindow ...@@ -85,6 +88,8 @@ class TopWindow: public GenericWindow
/// Change the active layout /// Change the active layout
virtual void setActiveLayout( GenericLayout *pLayout ); virtual void setActiveLayout( GenericLayout *pLayout );
/// Initial visibility status
bool m_visible;
/// Window manager /// Window manager
WindowManager &m_rWindowManager; WindowManager &m_rWindowManager;
/// Current active layout of the window /// Current active layout of the window
......
...@@ -195,13 +195,18 @@ void WindowManager::raiseAll() const ...@@ -195,13 +195,18 @@ void WindowManager::raiseAll() const
} }
void WindowManager::showAll() const void WindowManager::showAll( bool firstTime ) const
{ {
// Show all the windows // Show all the windows
WinSet_t::const_iterator it; WinSet_t::const_iterator it;
for( it = m_allWindows.begin(); it != m_allWindows.end(); it++ ) for( it = m_allWindows.begin(); it != m_allWindows.end(); it++ )
{
// When the theme is opened for the first time,
// only show the window if set as visible in the XML
if ((*it)->isVisible() || !firstTime)
{ {
(*it)->show(); (*it)->show();
}
(*it)->setOpacity( m_alpha ); (*it)->setOpacity( m_alpha );
} }
} }
......
...@@ -71,7 +71,7 @@ class WindowManager: public SkinObject ...@@ -71,7 +71,7 @@ class WindowManager: public SkinObject
void raiseAll() const; void raiseAll() const;
/// Show all the registered windows /// Show all the registered windows
void showAll() const; void showAll(bool firstTime = false) const;
/// Hide all the registered windows /// Hide all the registered windows
void hideAll() const; void hideAll() const;
......
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