Theming of disabled knobs (#5549)

Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
This commit is contained in:
thmueller64
2020-10-30 21:52:32 +01:00
committed by GitHub
parent 69a35b58d3
commit 2d51eaef3d
4 changed files with 79 additions and 67 deletions

View File

@@ -26,6 +26,8 @@
#ifndef KNOB_H
#define KNOB_H
#include <memory>
#include <QPixmap>
#include <QWidget>
#include <QtCore/QPoint>
@@ -41,6 +43,7 @@ enum knobTypes
} ;
void convertPixmapToGrayScale(QPixmap &pixMap);
class LMMS_EXPORT Knob : public QWidget, public FloatModelView
{
@@ -58,8 +61,12 @@ class LMMS_EXPORT Knob : public QWidget, public FloatModelView
// Unfortunately, the gradient syntax doesn't create our gradient
// correctly so we need to do this:
Q_PROPERTY(QColor outerColor READ outerColor WRITE setOuterColor)
Q_PROPERTY(QColor lineColor READ lineColor WRITE setlineColor)
Q_PROPERTY(QColor arcColor READ arcColor WRITE setarcColor)
Q_PROPERTY(QColor lineActiveColor MEMBER m_lineActiveColor)
Q_PROPERTY(QColor lineInactiveColor MEMBER m_lineInactiveColor)
Q_PROPERTY(QColor arcActiveColor MEMBER m_arcActiveColor)
Q_PROPERTY(QColor arcInactiveColor MEMBER m_arcInactiveColor)
mapPropertyFromModel(bool,isVolumeKnob,setVolumeKnob,m_volumeKnob);
mapPropertyFromModel(float,volumeRatio,setVolumeRatio,m_volumeRatio);
@@ -74,7 +81,6 @@ public:
Knob( knobTypes _knob_num, QWidget * _parent = NULL, const QString & _name = QString() );
Knob( QWidget * _parent = NULL, const QString & _name = QString() ); //!< default ctor
Knob( const Knob& other ) = delete;
virtual ~Knob();
// TODO: remove
inline void setHintText( const QString & _txt_before,
@@ -108,10 +114,6 @@ public:
QColor outerColor() const;
void setOuterColor( const QColor & c );
QColor lineColor() const;
void setlineColor( const QColor & c );
QColor arcColor() const;
void setarcColor( const QColor & c );
QColor textColor() const;
void setTextColor( const QColor & c );
@@ -134,6 +136,7 @@ protected:
void mouseDoubleClickEvent( QMouseEvent * _me ) override;
void paintEvent( QPaintEvent * _me ) override;
void wheelEvent( QWheelEvent * _me ) override;
void changeEvent(QEvent * ev) override;
virtual float getValue( const QPoint & _p );
@@ -169,7 +172,7 @@ private:
QString m_label;
QPixmap * m_knobPixmap;
std::unique_ptr<QPixmap> m_knobPixmap;
BoolModel m_volumeKnob;
FloatModel m_volumeRatio;
@@ -187,8 +190,11 @@ private:
float m_outerRadius;
float m_lineWidth;
QColor m_outerColor;
QColor m_lineColor; //!< unused yet
QColor m_arcColor; //!< unused yet
QColor m_lineActiveColor;
QColor m_lineInactiveColor;
QColor m_arcActiveColor;
QColor m_arcInactiveColor;
QColor m_textColor;