Commit 1f30e869 authored by Erwan Tulou's avatar Erwan Tulou

skins2: fix #689 (text control refresh issue)

This patch redefines the method associated with visibility
to ensure that the latest text is displayed when
the text control gets visible
parent 53e51f04
...@@ -211,6 +211,23 @@ void CtrlText::onUpdate( Subject<VarText> &rVariable, void* arg ) ...@@ -211,6 +211,23 @@ void CtrlText::onUpdate( Subject<VarText> &rVariable, void* arg )
} }
void CtrlText::onUpdate( Subject<VarBool> &rVariable, void *arg )
{
// Visibility changed
if( &rVariable == m_pVisible )
{
if( isVisible() )
{
displayText( m_rVariable.get() );
}
else
{
notifyLayout();
}
}
}
void CtrlText::displayText( const UString &rText ) void CtrlText::displayText( const UString &rText )
{ {
// Create the images ('normal' and 'double') from the text // Create the images ('normal' and 'double') from the text
......
...@@ -124,6 +124,9 @@ private: ...@@ -124,6 +124,9 @@ private:
/// Method called when the observed variable is modified /// Method called when the observed variable is modified
virtual void onUpdate( Subject<VarText> &rVariable, void* ); virtual void onUpdate( Subject<VarText> &rVariable, void* );
/// Method called when visibility is updated
virtual void onUpdate( Subject<VarBool> &rVariable , void* );
/// Display the text on the control /// Display the text on the control
void displayText( const UString &rText ); void displayText( const UString &rText );
......
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