[vlc-commits] Qt: Extend seekslider to use the old native look
Jean-Baptiste Kempf
git at videolan.org
Wed Feb 22 01:06:07 CET 2012
vlc/vlc-2.0 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Feb 22 00:54:43 2012 +0100| [0b37103cb791da2af0dcb277a84e1692e8d3f983] | committer: Jean-Baptiste Kempf
Qt: Extend seekslider to use the old native look
(cherry picked from commit 910b0583beb2523e5e092317c35e26d0856441f5)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=0b37103cb791da2af0dcb277a84e1692e8d3f983
---
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 df4631e..2fec736 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;
@@ -349,7 +349,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 e638b36..ccd20ab 100644
--- a/modules/gui/qt4/util/input_slider.hpp
+++ b/modules/gui/qt4/util/input_slider.hpp
@@ -46,7 +46,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 * );
@@ -78,6 +78,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