diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css index d098bf26660..1667ea5fe61 100644 --- a/data/themes/classic/style.css +++ b/data/themes/classic/style.css @@ -148,6 +148,7 @@ lmms--gui--PianoRoll { qproperty-noteModeColor: rgb( 255, 255, 255 ); qproperty-noteColor: rgb( 119, 199, 216 ); qproperty-stepNoteColor: #9b1313; + qproperty-currentStepNoteColor: rgb(245, 3, 139); qproperty-noteTextColor: rgb( 255, 255, 255 ); qproperty-noteOpacity: 128; qproperty-noteBorders: true; /* boolean property, set false to have borderless notes */ @@ -796,6 +797,21 @@ lmms--gui--SubWindow > QPushButton:hover{ border-radius: 2px; } +/* Instrument */ + +/* Envelope graph */ +lmms--gui--EnvelopeGraph { + qproperty-noAmountColor: rgb(96, 91, 96); + qproperty-fullAmountColor: rgb(0, 255, 128); + qproperty-markerFillColor: rgb(153, 175, 255); + qproperty-markerOutlineColor: rgb(0, 0, 0); +} + +/* LFO graph */ +lmms--gui--LfoGraph { + qproperty-noAmountColor: rgb(96, 91, 96); + qproperty-fullAmountColor: rgb(0, 255, 128); +} /* Plugins */ diff --git a/data/themes/default/style.css b/data/themes/default/style.css index 83933df199a..e3e2eec6a96 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -179,6 +179,7 @@ lmms--gui--PianoRoll { qproperty-noteModeColor: #0bd556; qproperty-noteColor: #0bd556; qproperty-stepNoteColor: #9b1313; + qproperty-currentStepNoteColor: rgb(245, 3, 139); qproperty-noteTextColor: #ffffff; qproperty-noteOpacity: 165; qproperty-noteBorders: false; /* boolean property, set false to have borderless notes */ @@ -835,6 +836,21 @@ lmms--gui--SubWindow > QPushButton:hover{ border-radius: 2px; } +/* Instrument */ + +/* Envelope graph */ +lmms--gui--EnvelopeGraph { + qproperty-noAmountColor: rgb(96, 91, 96); + qproperty-fullAmountColor: rgb(0, 255, 128); + qproperty-markerFillColor: rgb(153, 175, 255); + qproperty-markerOutlineColor: rgb(0, 0, 0); +} + +/* LFO graph */ +lmms--gui--LfoGraph { + qproperty-noAmountColor: rgb(96, 91, 96); + qproperty-fullAmountColor: rgb(0, 255, 128); +} /* Plugins */ diff --git a/include/EnvelopeGraph.h b/include/EnvelopeGraph.h index 4f8a5c38679..2ffa2f64bef 100644 --- a/include/EnvelopeGraph.h +++ b/include/EnvelopeGraph.h @@ -41,6 +41,12 @@ namespace gui class EnvelopeGraph : public QWidget, public ModelView { + Q_OBJECT + Q_PROPERTY(QColor noAmountColor MEMBER m_noAmountColor) + Q_PROPERTY(QColor fullAmountColor MEMBER m_fullAmountColor) + Q_PROPERTY(QColor markerFillColor MEMBER m_markerFillColor) + Q_PROPERTY(QColor markerOutlineColor MEMBER m_markerOutlineColor) + public: enum class ScalingMode { @@ -68,6 +74,11 @@ class EnvelopeGraph : public QWidget, public ModelView EnvelopeAndLfoParameters* m_params = nullptr; ScalingMode m_scaling = ScalingMode::Dynamic; + + QColor m_noAmountColor; + QColor m_fullAmountColor; + QColor m_markerFillColor; + QColor m_markerOutlineColor; }; } // namespace gui diff --git a/include/LfoGraph.h b/include/LfoGraph.h index 9d566770f09..fe56ecbb62f 100644 --- a/include/LfoGraph.h +++ b/include/LfoGraph.h @@ -41,6 +41,10 @@ namespace gui class LfoGraph : public QWidget, public ModelView { + Q_OBJECT + Q_PROPERTY(QColor noAmountColor MEMBER m_noAmountColor) + Q_PROPERTY(QColor fullAmountColor MEMBER m_fullAmountColor) + public: LfoGraph(QWidget* parent); @@ -56,6 +60,8 @@ class LfoGraph : public QWidget, public ModelView QPixmap m_lfoGraph = embed::getIconPixmap("lfo_graph"); float m_randomGraph {0.}; + QColor m_noAmountColor; + QColor m_fullAmountColor; }; } // namespace gui diff --git a/include/PianoRoll.h b/include/PianoRoll.h index a85e50a163b..e9939101c3f 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -74,6 +74,7 @@ class PianoRoll : public QWidget Q_PROPERTY(QColor noteModeColor MEMBER m_noteModeColor) Q_PROPERTY(QColor noteColor MEMBER m_noteColor) Q_PROPERTY(QColor stepNoteColor MEMBER m_stepNoteColor) + Q_PROPERTY(QColor currentStepNoteColor MEMBER m_currentStepNoteColor) Q_PROPERTY(QColor ghostNoteColor MEMBER m_ghostNoteColor) Q_PROPERTY(QColor noteTextColor MEMBER m_noteTextColor) Q_PROPERTY(QColor ghostNoteTextColor MEMBER m_ghostNoteTextColor) @@ -471,6 +472,7 @@ protected slots: QColor m_noteModeColor; QColor m_noteColor; QColor m_stepNoteColor; + QColor m_currentStepNoteColor; QColor m_noteTextColor; QColor m_ghostNoteColor; QColor m_ghostNoteTextColor; diff --git a/include/StepRecorder.h b/include/StepRecorder.h index 55435617c55..e085838e29c 100644 --- a/include/StepRecorder.h +++ b/include/StepRecorder.h @@ -66,11 +66,6 @@ class StepRecorder : public QObject return m_isRecording; } - QColor curStepNoteColor() const - { - return QColor(245,3,139); // radiant pink - } - private slots: void removeNotesReleasedForTooLong(); diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index a2d7c832aaa..efe903cc2a4 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -197,6 +197,9 @@ PianoRoll::PianoRoll() : m_lineColor( 0, 0, 0 ), m_noteModeColor( 0, 0, 0 ), m_noteColor( 0, 0, 0 ), + m_stepNoteColor(0, 0, 0), + m_currentStepNoteColor(245, 3, 139), + m_noteTextColor(0, 0, 0), m_ghostNoteColor( 0, 0, 0 ), m_ghostNoteTextColor( 0, 0, 0 ), m_barColor( 0, 0, 0 ), @@ -3596,7 +3599,7 @@ void PianoRoll::paintEvent(QPaintEvent * pe ) // we've done and checked all, let's draw the note drawNoteRect( p, x + m_whiteKeyWidth, noteYPos(note->key()), note_width, - note, m_stepRecorder.curStepNoteColor(), m_noteTextColor, m_selectedNoteColor, + note, m_currentStepNoteColor, m_noteTextColor, m_selectedNoteColor, m_noteOpacity, m_noteBorders, drawNoteNames); } } diff --git a/src/gui/instrument/EnvelopeGraph.cpp b/src/gui/instrument/EnvelopeGraph.cpp index 4cf5da74bfa..3483f46a0fa 100644 --- a/src/gui/instrument/EnvelopeGraph.cpp +++ b/src/gui/instrument/EnvelopeGraph.cpp @@ -44,7 +44,11 @@ namespace gui EnvelopeGraph::EnvelopeGraph(QWidget* parent) : QWidget(parent), - ModelView(nullptr, this) + ModelView(nullptr, this), + m_noAmountColor(96, 91, 96), + m_fullAmountColor(0, 255, 128), + m_markerFillColor(153, 175, 255), + m_markerOutlineColor(0, 0, 0) { setMinimumSize(m_envGraph.size()); } @@ -206,9 +210,7 @@ void EnvelopeGraph::paintEvent(QPaintEvent*) // Compute the color of the lines based on the amount of the envelope const float absAmount = std::abs(amount); - const QColor noAmountColor{96, 91, 96}; - const QColor fullAmountColor{0, 255, 128}; - const QColor lineColor{ColorHelper::interpolateInRgb(noAmountColor, fullAmountColor, absAmount)}; + const QColor lineColor{ColorHelper::interpolateInRgb(m_noAmountColor, m_fullAmountColor, absAmount)}; // Determine the line width so that it scales with the widget // Use the minimum value of the current width and height to compute it. @@ -221,14 +223,11 @@ void EnvelopeGraph::paintEvent(QPaintEvent*) p.drawPolyline(linePoly); // Now draw all marker on top of the lines - const QColor markerFillColor{153, 175, 255}; - const QColor markerOutlineColor{0, 0, 0}; - QPen pen; pen.setWidthF(lineWidth * 0.75); - pen.setBrush(markerOutlineColor); + pen.setBrush(m_markerOutlineColor); p.setPen(pen); - p.setBrush(markerFillColor); + p.setBrush(m_markerFillColor); // Compute the size of the circle we will draw based on the line width const qreal baseRectSize = lineWidth * 3; diff --git a/src/gui/instrument/LfoGraph.cpp b/src/gui/instrument/LfoGraph.cpp index 7444eeb4608..fe8e01a7f33 100644 --- a/src/gui/instrument/LfoGraph.cpp +++ b/src/gui/instrument/LfoGraph.cpp @@ -44,7 +44,9 @@ namespace gui LfoGraph::LfoGraph(QWidget* parent) : QWidget(parent), - ModelView(nullptr, this) + ModelView(nullptr, this), + m_noAmountColor(96, 91, 96), + m_fullAmountColor(0, 255, 128) { setMinimumSize(m_lfoGraph.size()); } @@ -143,9 +145,7 @@ void LfoGraph::paintEvent(QPaintEvent*) // Compute the color of the lines based on the amount of the LFO const float absAmount = std::abs(amount); - const QColor noAmountColor{96, 91, 96}; - const QColor fullAmountColor{0, 255, 128}; - const QColor lineColor{ColorHelper::interpolateInRgb(noAmountColor, fullAmountColor, absAmount)}; + const QColor lineColor{ColorHelper::interpolateInRgb(m_noAmountColor, m_fullAmountColor, absAmount)}; p.setPen(QPen(lineColor, 1.5));