Browse Source

Merge pull request #1003 from Fenrirthviti/theme-updates

UI: Allow volume peak to be customized via .qss
Jim 8 years ago
parent
commit
34b0f29dc5
3 changed files with 31 additions and 5 deletions
  1. 5 5
      UI/data/themes/Rachni.qss
  2. 20 0
      UI/volume-control.cpp
  3. 6 0
      UI/volume-control.hpp

+ 5 - 5
UI/data/themes/Rachni.qss

@@ -671,9 +671,11 @@ QProgressBar::chunk {
 
 VolumeMeter {
 	qproperty-bkColor: rgb(35, 38, 41); /* Dark Gray */
-	qproperty-magColor: rgb(186, 45, 101); /* Dark Pink (Secondary Dark) */
-	qproperty-peakColor: rgb(240, 98, 146); /* Pink (Secondary) */
-	qproperty-peakHoldColor: rgb(255, 148, 194); /* Light Pink (Secondary Light) */
+	qproperty-magColor: rgb(153, 204, 0);
+	qproperty-peakColor: rgb(96, 128, 0);
+	qproperty-peakHoldColor: rgb(210, 255, 77);
+	qproperty-clipColor1: rgb(230, 40, 50);
+	qproperty-clipColor2: rgb(140, 0, 40);
 }
 
 /*******************/
@@ -719,8 +721,6 @@ QPushButton:disabled {
 	color: rgb(162, 161, 162); /* Lighter Gray */
 }
 
-
-
 /******************************/
 /* --- Dialog Box Buttons --- */
 /******************************/

+ 20 - 0
UI/volume-control.cpp

@@ -255,6 +255,26 @@ void VolumeMeter::setPeakHoldColor(QColor c)
 	peakHoldColor = c;
 }
 
+QColor VolumeMeter::getClipColor1() const
+{
+	return clipColor1;
+}
+
+void VolumeMeter::setClipColor1(QColor c)
+{
+	clipColor1 = c;
+}
+
+QColor VolumeMeter::getClipColor2() const
+{
+	return clipColor2;
+}
+
+void VolumeMeter::setClipColor2(QColor c)
+{
+	clipColor2 = c;
+}
+
 
 VolumeMeter::VolumeMeter(QWidget *parent)
 			: QWidget(parent)

+ 6 - 0
UI/volume-control.hpp

@@ -17,6 +17,8 @@ class VolumeMeter : public QWidget
 	Q_PROPERTY(QColor magColor READ getMagColor WRITE setMagColor DESIGNABLE true)
 	Q_PROPERTY(QColor peakColor READ getPeakColor WRITE setPeakColor DESIGNABLE true)
 	Q_PROPERTY(QColor peakHoldColor READ getPeakHoldColor WRITE setPeakHoldColor DESIGNABLE true)
+	Q_PROPERTY(QColor clipColor1 READ getClipColor1 WRITE setClipColor1 DESIGNABLE true)
+	Q_PROPERTY(QColor clipColor2 READ getClipColor2 WRITE setClipColor2 DESIGNABLE true)
 
 private:
 	static QWeakPointer<VolumeMeterTimer> updateTimer;
@@ -46,6 +48,10 @@ public:
 	void setPeakColor(QColor c);
 	QColor getPeakHoldColor() const;
 	void setPeakHoldColor(QColor c);
+	QColor getClipColor1() const;
+	void setClipColor1(QColor c);
+	QColor getClipColor2() const;
+	void setClipColor2(QColor c);
 
 protected:
 	void paintEvent(QPaintEvent *event);