[vlc-devel] [PATCH 3/3] Qt: Fix SpeedLabel's tooltip

Francois Cartegnie fcvlcdev at free.fr
Wed Mar 10 23:13:29 CET 2010


---
 modules/gui/qt4/components/interface_widgets.cpp |    4 ++--
 modules/gui/qt4/components/interface_widgets.hpp |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 78f5b5a..36a1c2a 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -410,7 +410,7 @@ void VisualSelector::next()
 SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, QWidget *parent )
            : QLabel( parent ), p_intf( _p_intf )
 {
-    setToolTip( qtr( "Current playback speed.\nClick to adjust" ) );
+    tooltipStringPattern = qtr( "Current playback speed: %1\nClick to adjust" );
 
     /* Create the Speed Control Widget */
     speedControl = new SpeedControlWidget( p_intf, this );
@@ -450,7 +450,7 @@ void SpeedLabel::setRate( float rate )
     str.setNum( rate, 'f', 2 );
     str.append( "x" );
     setText( str );
-    setToolTip( str );
+    setToolTip( tooltipStringPattern.arg( str ) );
     speedControl->updateControls( rate );
 }
 
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index 4bda22b..68e3d09 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -175,6 +175,7 @@ private slots:
 private:
     intf_thread_t *p_intf;
     QMenu *speedControlMenu;
+    QString tooltipStringPattern;
     SpeedControlWidget *speedControl;
 };
 
-- 
1.6.4.4




More information about the vlc-devel mailing list