Commit 7ce614bd authored by Olivier Teulière's avatar Olivier Teulière

* skins2: when the user click on a window, raise onl this window.

   This avoids a flickering when 2 windows are overlapping.
parent 1200a79d
...@@ -72,13 +72,13 @@ void GenericWindow::processEvent( EvtRefresh &rEvtRefresh ) ...@@ -72,13 +72,13 @@ void GenericWindow::processEvent( EvtRefresh &rEvtRefresh )
} }
void GenericWindow::show() void GenericWindow::show() const
{ {
m_varVisible.set( true ); m_varVisible.set( true );
} }
void GenericWindow::hide() void GenericWindow::hide() const
{ {
m_varVisible.set( false ); m_varVisible.set( false );
} }
......
...@@ -84,10 +84,10 @@ class GenericWindow: public SkinObject, public Observer<VarBool> ...@@ -84,10 +84,10 @@ class GenericWindow: public SkinObject, public Observer<VarBool>
/// only by the window manager or by inheritant classes. /// only by the window manager or by inheritant classes.
//@{ //@{
/// Show the window /// Show the window
virtual void show(); virtual void show() const;
/// Hide the window /// Hide the window
virtual void hide(); virtual void hide() const;
/// Move the window /// Move the window
virtual void move( int left, int top ); virtual void move( int left, int top );
...@@ -114,7 +114,7 @@ class GenericWindow: public SkinObject, public Observer<VarBool> ...@@ -114,7 +114,7 @@ class GenericWindow: public SkinObject, public Observer<VarBool>
/// OS specific implementation /// OS specific implementation
OSWindow *m_pOsWindow; OSWindow *m_pOsWindow;
/// Variable for the visibility of the window /// Variable for the visibility of the window
VarBoolImpl m_varVisible; mutable VarBoolImpl m_varVisible;
/// Method called when the observed variable is modified /// Method called when the observed variable is modified
virtual void onUpdate( Subject<VarBool> &rVariable ); virtual void onUpdate( Subject<VarBool> &rVariable );
......
...@@ -130,8 +130,8 @@ void TopWindow::processEvent( EvtMouse &rEvtMouse ) ...@@ -130,8 +130,8 @@ void TopWindow::processEvent( EvtMouse &rEvtMouse )
// Change the focused control // Change the focused control
if( rEvtMouse.getAction() == EvtMouse::kDown ) if( rEvtMouse.getAction() == EvtMouse::kDown )
{ {
// Raise all the windows // Raise the window
m_rWindowManager.raiseAll( *this ); m_rWindowManager.raise( *this );
if( pNewHitControl && pNewHitControl->isFocusable() ) if( pNewHitControl && pNewHitControl->isFocusable() )
{ {
......
...@@ -76,11 +76,14 @@ class WindowManager: public SkinObject ...@@ -76,11 +76,14 @@ class WindowManager: public SkinObject
/// Hide all the registered windows /// Hide all the registered windows
void hideAll() const; void hideAll() const;
/// Raise the given window
void raise( TopWindow &rWindow ) const { rWindow.raise(); }
/// Show the given window /// Show the given window
void show( TopWindow &rWindow ) { rWindow.show(); } void show( TopWindow &rWindow ) const { rWindow.show(); }
/// Hide the given window /// Hide the given window
void hide( TopWindow &rWindow ) { rWindow.hide(); } void hide( TopWindow &rWindow ) const { rWindow.hide(); }
/// Toggle all the windows on top /// Toggle all the windows on top
void toggleOnTop(); void toggleOnTop();
......
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