]> git.sesse.net Git - vlc/commitdiff
skins2: fix #689 (text control refresh issue)
authorErwan Tulou <erwan10@videolan.org>
Tue, 23 Feb 2010 21:56:03 +0000 (22:56 +0100)
committerErwan Tulou <erwan10@videolan.org>
Tue, 23 Feb 2010 22:11:24 +0000 (23:11 +0100)
This patch redefines the method associated with visibility
to ensure that the latest text is displayed when
the text control gets visible

modules/gui/skins2/controls/ctrl_text.cpp
modules/gui/skins2/controls/ctrl_text.hpp

index e32da13683a8a0cfff3190cf1cd0a5f9ab1a5952..a6c90a03886824238f498f019d0dc5135eb0a7e1 100644 (file)
@@ -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 )
 {
     // Create the images ('normal' and 'double') from the text
index ecebd37a0d6699312676fe8a6cbcfe3c1c57e107..eafdb8e1b9083d1bbda04dc156f90646b3bf3289 100644 (file)
@@ -124,6 +124,9 @@ private:
     /// Method called when the observed variable is modified
     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
     void displayText( const UString &rText );