[vlc-devel] commit: skins2: fix #689 (text control refresh issue) (Erwan Tulou )

git version control git at videolan.org
Tue Feb 23 23:15:53 CET 2010


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Tue Feb 23 22:56:03 2010 +0100| [1f30e8690b43fb90f1ff7ed9588e95830f525e3b] | committer: 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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f30e8690b43fb90f1ff7ed9588e95830f525e3b
---

 modules/gui/skins2/controls/ctrl_text.cpp |   17 +++++++++++++++++
 modules/gui/skins2/controls/ctrl_text.hpp |    3 +++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/modules/gui/skins2/controls/ctrl_text.cpp b/modules/gui/skins2/controls/ctrl_text.cpp
index e32da13..a6c90a0 100644
--- a/modules/gui/skins2/controls/ctrl_text.cpp
+++ b/modules/gui/skins2/controls/ctrl_text.cpp
@@ -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
diff --git a/modules/gui/skins2/controls/ctrl_text.hpp b/modules/gui/skins2/controls/ctrl_text.hpp
index ecebd37..eafdb8e 100644
--- a/modules/gui/skins2/controls/ctrl_text.hpp
+++ b/modules/gui/skins2/controls/ctrl_text.hpp
@@ -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 );
 




More information about the vlc-devel mailing list