Commit 0b37103c authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: Extend seekslider to use the old native look

(cherry picked from commit 910b0583beb2523e5e092317c35e26d0856441f5)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 844056d2
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
#define FADEDURATION 300 #define FADEDURATION 300
#define FADEOUTDELAY 2000 #define FADEOUTDELAY 2000
SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent ) SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static )
: QSlider( q, _parent ) : QSlider( q, _parent ), b_classic( _static )
{ {
isSliding = false; isSliding = false;
f_buffering = 1.0; f_buffering = 1.0;
...@@ -349,7 +349,8 @@ QSize SeekSlider::handleSize() const ...@@ -349,7 +349,8 @@ QSize SeekSlider::handleSize() const
void SeekSlider::paintEvent( QPaintEvent *event ) void SeekSlider::paintEvent( QPaintEvent *event )
{ {
Q_UNUSED( event ); if( b_classic )
return QSlider::paintEvent( event );
QStyleOptionSlider option; QStyleOptionSlider option;
initStyleOption( &option ); initStyleOption( &option );
......
...@@ -46,7 +46,7 @@ class SeekSlider : public QSlider ...@@ -46,7 +46,7 @@ class SeekSlider : public QSlider
Q_OBJECT Q_OBJECT
Q_PROPERTY(qreal handleOpacity READ handleOpacity WRITE setHandleOpacity) Q_PROPERTY(qreal handleOpacity READ handleOpacity WRITE setHandleOpacity)
public: public:
SeekSlider( Qt::Orientation q, QWidget *_parent = 0 ); SeekSlider( Qt::Orientation q, QWidget *_parent = 0, bool _classic = false );
~SeekSlider(); ~SeekSlider();
void setChapters( SeekPoints * ); void setChapters( SeekPoints * );
...@@ -78,6 +78,7 @@ private: ...@@ -78,6 +78,7 @@ private:
TimeTooltip *mTimeTooltip; TimeTooltip *mTimeTooltip;
float f_buffering; float f_buffering;
SeekPoints* chapters; SeekPoints* chapters;
bool b_classic;
/* Handle's animation */ /* Handle's animation */
qreal mHandleOpacity; qreal mHandleOpacity;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment