From d09397a8abdc397ab8e7a63d142e9ddcc0e107a7 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Wed, 17 Aug 2011 02:35:06 +0200 Subject: [PATCH] * Moved the AudioControl QSlider stylesheets into SeekSlider. --- src/audiocontrols.cpp | 37 -------------------------- src/libtomahawk/widgets/SeekSlider.cpp | 21 +++++++++++++-- src/libtomahawk/widgets/SeekSlider.h | 3 --- 3 files changed, 19 insertions(+), 42 deletions(-) diff --git a/src/audiocontrols.cpp b/src/audiocontrols.cpp index ee806f19c..ca161106c 100644 --- a/src/audiocontrols.cpp +++ b/src/audiocontrols.cpp @@ -91,46 +91,9 @@ AudioControls::AudioControls( QWidget* parent ) ui->ownerLabel->setForegroundRole( QPalette::Dark ); ui->metaDataArea->setStyleSheet( "QWidget#metaDataArea {\nborder-width: 4px;\nborder-image: url(" RESPATH "images/now-playing-panel.png) 4 4 4 4 stretch stretch; }" ); - ui->seekSlider->setFixedHeight( 20 ); ui->seekSlider->setEnabled( true ); - ui->seekSlider->setStyleSheet( "QSlider::groove::horizontal {" - "margin: 5px; border-width: 3px;" - "border-image: url(" RESPATH "images/seek-slider-bkg.png) 3 3 3 3 stretch stretch;" - "}" - - "QSlider::sub-page:horizontal {" - "margin: 5px; border-width: 3px;" - "border-image: url(" RESPATH "images/seek-slider-level.png) 3 3 3 3 stretch stretch;" - "}" - - "QSlider::handle::horizontal {" - "margin-bottom: -7px; margin-top: -7px;" - "margin-left: -4px; margin-right: -4px;" - "height: 17px; width: 16px;" - "background-image: url(" RESPATH "images/seek-and-volume-knob-rest.png);" - "background-repeat: no-repeat;" - "}" ); - - ui->volumeSlider->setFixedHeight( 20 ); ui->volumeSlider->setRange( 0, 100 ); ui->volumeSlider->setValue( AudioEngine::instance()->volume() ); - ui->volumeSlider->setStyleSheet( "QSlider::groove::horizontal {" - "margin: 5px; border-width: 3px;" - "border-image: url(" RESPATH "images/volume-slider-bkg.png) 3 3 3 3 stretch stretch;" - "}" - - "QSlider::sub-page:horizontal {" - "margin: 5px; border-width: 3px;" - "border-image: url(" RESPATH "images/seek-slider-level.png) 3 3 3 3 stretch stretch;" - "}" - - "QSlider::handle::horizontal {" - "margin-bottom: -7px; margin-top: -7px;" - "margin-left: -4px; margin-right: -4px;" - "height: 17px; width: 16px;" - "background-image: url(" RESPATH "images/seek-and-volume-knob-rest.png);" - "background-repeat: no-repeat;" - "}" ); connect( ui->seekSlider, SIGNAL( valueChanged( int ) ), AudioEngine::instance(), SLOT( seek( int ) ) ); connect( ui->volumeSlider, SIGNAL( valueChanged( int ) ), AudioEngine::instance(), SLOT( setVolume( int ) ) ); diff --git a/src/libtomahawk/widgets/SeekSlider.cpp b/src/libtomahawk/widgets/SeekSlider.cpp index fcc335209..007c18bef 100644 --- a/src/libtomahawk/widgets/SeekSlider.cpp +++ b/src/libtomahawk/widgets/SeekSlider.cpp @@ -19,15 +19,32 @@ #include "SeekSlider.h" #include -#include +#include "utils/tomahawkutils.h" #include "utils/logger.h" SeekSlider::SeekSlider( QWidget* parent ) : QSlider( parent ) - , m_parent( parent ) { + setFixedHeight( 20 ); + setStyleSheet( "QSlider::groove::horizontal {" + "margin: 5px; border-width: 3px;" + "border-image: url(" RESPATH "images/seek-slider-bkg.png) 3 3 3 3 stretch stretch;" + "}" + + "QSlider::sub-page:horizontal {" + "margin: 5px; border-width: 3px;" + "border-image: url(" RESPATH "images/seek-slider-level.png) 3 3 3 3 stretch stretch;" + "}" + + "QSlider::handle::horizontal {" + "margin-bottom: -7px; margin-top: -7px;" + "margin-left: -4px; margin-right: -4px;" + "height: 17px; width: 16px;" + "background-image: url(" RESPATH "images/seek-and-volume-knob-rest.png);" + "background-repeat: no-repeat;" + "}" ); } diff --git a/src/libtomahawk/widgets/SeekSlider.h b/src/libtomahawk/widgets/SeekSlider.h index 6b6a41acb..42392b202 100644 --- a/src/libtomahawk/widgets/SeekSlider.h +++ b/src/libtomahawk/widgets/SeekSlider.h @@ -33,9 +33,6 @@ public: protected: void mousePressEvent( QMouseEvent* event ); - -private: - QWidget* m_parent; }; #endif // SEEKSLIDER_H