Commit dccb47b8 authored by Cyril Deguet's avatar Cyril Deguet
Browse files

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