[vlc-commits] Qt: Extend seekslider to use the old native look

Jean-Baptiste Kempf git at videolan.org
Wed Feb 22 01:02:31 CET 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Feb 22 00:54:43 2012 +0100| [910b0583beb2523e5e092317c35e26d0856441f5] | committer: Jean-Baptiste Kempf

Qt: Extend seekslider to use the old native look

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

 modules/gui/qt4/util/input_slider.cpp |    7 ++++---
 modules/gui/qt4/util/input_slider.hpp |    3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/util/input_slider.cpp b/modules/gui/qt4/util/input_slider.cpp
index 604c571..d1212af 100644
--- a/modules/gui/qt4/util/input_slider.cpp
+++ b/modules/gui/qt4/util/input_slider.cpp
@@ -55,8 +55,8 @@
 #define FADEDURATION 300
 #define FADEOUTDELAY 2000
 
-SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent )
-          : QSlider( q, _parent )
+SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static )
+          : QSlider( q, _parent ), b_classic( _static )
 {
     isSliding = false;
     f_buffering = 1.0;
@@ -350,7 +350,8 @@ QSize SeekSlider::handleSize() const
 
 void SeekSlider::paintEvent( QPaintEvent *event )
 {
-    Q_UNUSED( event );
+    if( b_classic )
+        return QSlider::paintEvent( event );
 
     QStyleOptionSlider option;
     initStyleOption( &option );
diff --git a/modules/gui/qt4/util/input_slider.hpp b/modules/gui/qt4/util/input_slider.hpp
index eebaa3e..3e052e8 100644
--- a/modules/gui/qt4/util/input_slider.hpp
+++ b/modules/gui/qt4/util/input_slider.hpp
@@ -50,7 +50,7 @@ class SeekSlider : public QSlider
     Q_OBJECT
     Q_PROPERTY(qreal handleOpacity READ handleOpacity WRITE setHandleOpacity)
 public:
-    SeekSlider( Qt::Orientation q, QWidget *_parent = 0 );
+    SeekSlider( Qt::Orientation q, QWidget *_parent = 0, bool _classic = false );
     ~SeekSlider();
     void setChapters( SeekPoints * );
 
@@ -82,6 +82,7 @@ private:
     TimeTooltip *mTimeTooltip;
     float f_buffering;
     SeekPoints* chapters;
+    bool b_classic;
 
     /* Handle's animation */
     qreal mHandleOpacity;



More information about the vlc-commits mailing list