diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css
index 8d8854028..a064366a6 100644
--- a/data/themes/classic/style.css
+++ b/data/themes/classic/style.css
@@ -376,32 +376,61 @@ lmms--gui--TrackContentWidget {
/* gear button in tracks */
+
+/* 20px = 1px border + 2px padding + 14px icon + 2px padding + 1px border */
+QPushButton#btn-mute,
+QPushButton#btn-mute-inv:checked,
+QPushButton#btn-solo,
lmms--gui--TrackOperationsWidget QPushButton {
- max-height: 26px;
- max-width: 26px;
- min-height: 26px;
- min-width: 26px;
- background: none;
- border: none;
+ min-height: 14;
+ max-height: 14;
+ min-width: 14;
+ max-width: 14;
+ padding: 2;
+ border: 1 solid #0f1621;
+ border-top: 1 solid #18202b;
+ border-bottom: 1 solid #02060f;
+ border-radius: 4;
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 255, 255, 20%), stop:0.1 rgba(255, 255, 255, 2%), stop:0.9 rgba(0, 0, 0, 2%), stop:1 rgba(0, 0, 0, 40%));
}
lmms--gui--TrackOperationsWidget QPushButton::menu-indicator {
- image: url("resources:trackop.png");
- subcontrol-origin: padding;
- subcontrol-position: center;
- position: relative;
- top: 1px;
+ image: none;
}
-lmms--gui--TrackOperationsWidget QPushButton::menu-indicator:hover {
- image: url("resources:trackop_h.png");
+lmms--gui--TrackOperationsWidget QPushButton {
+ image: url("resources:gear.svg");
}
-lmms--gui--TrackOperationsWidget QPushButton::menu-indicator:pressed,
-lmms--gui--TrackOperationsWidget QPushButton::menu-indicator:checked {
- image: url("resources:trackop_c.png");
- position: relative;
- top: 2px;
+QPushButton#btn-mute,
+QPushButton#btn-mute-inv:checked {
+ image: url("resources:speaker.svg");
+}
+
+QPushButton#btn-solo {
+ image: url("resources:headphones.svg");
+}
+
+QPushButton#btn-mute:hover,
+QPushButton#btn-solo:hover,
+lmms--gui--TrackOperationsWidget QPushButton:hover {
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 255, 255, 25%), stop:0.1 rgba(255, 255, 255, 7%), stop:0.9 transparent, stop:1 rgba(0, 0, 0, 35%));
+}
+
+lmms--gui--TrackOperationsWidget QPushButton:pressed {
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0, 0, 0, 25%), stop:0.1 transparent, stop:0.8 rgba(0, 0, 0, 15%), stop:1 rgba(0, 0, 0, 35%));
+}
+
+QPushButton#btn-mute-inv,
+QPushButton#btn-mute:checked {
+ image: url("resources:speaker_slash.svg");
+ border: 1 solid #890120;
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #e2515b, stop:0.1 #d40237, stop:0.9 #d40237, stop:1 #900122);
+}
+
+QPushButton#btn-solo:checked {
+ border: 1 solid #055f89;
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #5aa8d9, stop:0.1 #2696d1, stop:0.9 #2696d1, stop:1 #16638c);
}
/* actually has no effect yet so disabled */
diff --git a/data/themes/default/gear.svg b/data/themes/default/gear.svg
new file mode 100644
index 000000000..dfcd7d4d9
--- /dev/null
+++ b/data/themes/default/gear.svg
@@ -0,0 +1,26 @@
+
+
diff --git a/data/themes/default/headphones.svg b/data/themes/default/headphones.svg
new file mode 100644
index 000000000..ecdc5a18e
--- /dev/null
+++ b/data/themes/default/headphones.svg
@@ -0,0 +1,44 @@
+
+
diff --git a/data/themes/default/mute_active.svg b/data/themes/default/mute_active.svg
deleted file mode 100644
index 600144697..000000000
--- a/data/themes/default/mute_active.svg
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
diff --git a/data/themes/default/mute_inactive.svg b/data/themes/default/mute_inactive.svg
deleted file mode 100644
index 6042cc767..000000000
--- a/data/themes/default/mute_inactive.svg
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
diff --git a/data/themes/default/solo_active.svg b/data/themes/default/solo_active.svg
deleted file mode 100644
index d5c151be3..000000000
--- a/data/themes/default/solo_active.svg
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
diff --git a/data/themes/default/solo_inactive.svg b/data/themes/default/solo_inactive.svg
deleted file mode 100644
index 57788c607..000000000
--- a/data/themes/default/solo_inactive.svg
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
diff --git a/data/themes/default/speaker.svg b/data/themes/default/speaker.svg
new file mode 100644
index 000000000..1f43f5517
--- /dev/null
+++ b/data/themes/default/speaker.svg
@@ -0,0 +1,42 @@
+
+
diff --git a/data/themes/default/speaker_slash.svg b/data/themes/default/speaker_slash.svg
new file mode 100644
index 000000000..9b42db7ac
--- /dev/null
+++ b/data/themes/default/speaker_slash.svg
@@ -0,0 +1,44 @@
+
+
diff --git a/data/themes/default/style.css b/data/themes/default/style.css
index 184bc9b56..07ee74617 100644
--- a/data/themes/default/style.css
+++ b/data/themes/default/style.css
@@ -412,30 +412,64 @@ lmms--gui--TrackContentWidget {
/* gear button in tracks */
+
+/* 20px = 1px border + 2px padding + 14px icon + 2px padding + 1px border */
+QPushButton#btn-mute,
+QPushButton#btn-mute-inv:checked,
+QPushButton#btn-solo,
lmms--gui--TrackOperationsWidget QPushButton {
- max-height: 26px;
- max-width: 26px;
- min-height: 26px;
- min-width: 26px;
- background: none;
- border: none;
+ min-height: 14;
+ max-height: 14;
+ min-width: 14;
+ max-width: 14;
+ padding: 2;
+ border: 1 solid #0f1621;
+ border-top: 1 solid #18202b;
+ border-bottom: 1 solid #02060f;
+ border-radius: 2;
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 255, 255, 20%), stop:0.1 rgba(255, 255, 255, 2%), stop:0.9 rgba(0, 0, 0, 2%), stop:1 rgba(0, 0, 0, 40%));
}
lmms--gui--TrackOperationsWidget QPushButton::menu-indicator {
- image: url("resources:trackop.png");
- subcontrol-origin: padding;
- subcontrol-position: center;
- position: relative;
- top: 1px;
+ image: none;
}
-lmms--gui--TrackOperationsWidget QPushButton::menu-indicator:pressed,
-lmms--gui--TrackOperationsWidget QPushButton::menu-indicator:checked {
- image: url("resources:trackop.png");
- position: relative;
- top: 2px;
+lmms--gui--TrackOperationsWidget QPushButton {
+ image: url("resources:gear.svg");
}
+QPushButton#btn-mute,
+QPushButton#btn-mute-inv:checked {
+ image: url("resources:speaker.svg");
+}
+
+QPushButton#btn-solo {
+ image: url("resources:headphones.svg");
+}
+
+QPushButton#btn-mute:hover,
+QPushButton#btn-solo:hover,
+lmms--gui--TrackOperationsWidget QPushButton:hover {
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 255, 255, 25%), stop:0.1 rgba(255, 255, 255, 7%), stop:0.9 transparent, stop:1 rgba(0, 0, 0, 35%));
+}
+
+lmms--gui--TrackOperationsWidget QPushButton:pressed {
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0, 0, 0, 25%), stop:0.1 transparent, stop:0.8 rgba(0, 0, 0, 15%), stop:1 rgba(0, 0, 0, 35%));
+}
+
+QPushButton#btn-mute-inv,
+QPushButton#btn-mute:checked {
+ image: url("resources:speaker_slash.svg");
+ border: 1 solid #890120;
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #e2515b, stop:0.1 #d40237, stop:0.9 #d40237, stop:1 #900122);
+}
+
+QPushButton#btn-solo:checked {
+ border: 1 solid #055f89;
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #5aa8d9, stop:0.1 #2696d1, stop:0.9 #2696d1, stop:1 #16638c);
+}
+
+
/* font sizes */
lmms--gui--Sf2InstrumentView > QLabel {
diff --git a/data/themes/default/trackop.png b/data/themes/default/trackop.png
deleted file mode 100644
index a4f90e35c..000000000
Binary files a/data/themes/default/trackop.png and /dev/null differ
diff --git a/include/InstrumentTrackWindow.h b/include/InstrumentTrackWindow.h
index 5d26ba9a2..6f0245875 100644
--- a/include/InstrumentTrackWindow.h
+++ b/include/InstrumentTrackWindow.h
@@ -27,8 +27,8 @@
#include
+#include "AutomatableButton.h"
#include "ModelView.h"
-#include "PixmapButton.h"
#include "SerializingObject.h"
#include "PluginView.h"
@@ -148,8 +148,8 @@ private:
Knob * m_volumeKnob;
Knob * m_panningKnob;
Knob * m_pitchKnob;
- PixmapButton *m_muteBtn;
- PixmapButton *m_soloBtn;
+ AutomatableButton* m_muteBtn;
+ AutomatableButton* m_soloBtn;
QLabel * m_pitchLabel;
LcdSpinBox* m_pitchRangeSpinBox;
QLabel * m_pitchRangeLabel;
diff --git a/include/MixerChannelView.h b/include/MixerChannelView.h
index 3d5f4ffb6..e9ee1eddb 100644
--- a/include/MixerChannelView.h
+++ b/include/MixerChannelView.h
@@ -115,8 +115,8 @@ private:
QLineEdit* m_renameLineEdit;
QGraphicsView* m_renameLineEditView;
QLabel* m_sendArrow;
- PixmapButton* m_muteButton;
- PixmapButton* m_soloButton;
+ AutomatableButton* m_muteButton;
+ AutomatableButton* m_soloButton;
PeakIndicator* m_peakIndicator = nullptr;
Fader* m_fader;
EffectRackView* m_effectRackView;
diff --git a/include/SampleTrackWindow.h b/include/SampleTrackWindow.h
index 01adb0080..f9aa0f71c 100644
--- a/include/SampleTrackWindow.h
+++ b/include/SampleTrackWindow.h
@@ -28,9 +28,9 @@
#include
#include "ModelView.h"
-#include "PixmapButton.h"
#include "SampleTrack.h"
#include "SerializingObject.h"
+#include "AutomatableButton.h"
class QLineEdit;
@@ -91,8 +91,8 @@ private:
QLineEdit * m_nameLineEdit;
Knob * m_volumeKnob;
Knob * m_panningKnob;
- PixmapButton *m_muteBtn;
- PixmapButton *m_soloBtn;
+ AutomatableButton* m_muteBtn;
+ AutomatableButton* m_soloBtn;
MixerChannelLcdSpinBox * m_mixerChannelNumber;
EffectRackView * m_effectRack;
diff --git a/include/TrackOperationsWidget.h b/include/TrackOperationsWidget.h
index 8417298b4..3eb9215b9 100644
--- a/include/TrackOperationsWidget.h
+++ b/include/TrackOperationsWidget.h
@@ -26,6 +26,7 @@
#define LMMS_GUI_TRACK_OPERATIONS_WIDGET_H
#include
+#include "AutomatableButton.h"
class QPushButton;
@@ -69,8 +70,8 @@ private:
TrackGrip* m_trackGrip;
QPushButton * m_trackOps;
- PixmapButton * m_muteBtn;
- PixmapButton * m_soloBtn;
+ AutomatableButton* m_muteBtn;
+ AutomatableButton* m_soloBtn;
friend class TrackView;
diff --git a/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp b/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp
index 93aaf0cff..c3a61890d 100644
--- a/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp
+++ b/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp
@@ -56,9 +56,9 @@ CrossoverEQControlDialog::CrossoverEQControlDialog(CrossoverEQControls *controls
layout->addLayout(knobsLayout);
const auto makeKnob = [this, knobsLayout](
- FloatModel *model,
- const QString &label,
- const QString &txt_before
+ FloatModel* model,
+ const QString& label,
+ const QString& txt_before
) {
auto k = new Knob(KnobType::Bright26, this);
k->setModel(model);
@@ -76,8 +76,8 @@ CrossoverEQControlDialog::CrossoverEQControlDialog(CrossoverEQControls *controls
layout->addLayout(bandsLayout);
const auto makeFader = [this, bandsLayout](
- FloatModel *model,
- const QString &label,
+ FloatModel* model,
+ const QString& label,
int column
) {
auto f = new Fader(model, label, this, false);
@@ -92,20 +92,16 @@ CrossoverEQControlDialog::CrossoverEQControlDialog(CrossoverEQControls *controls
makeFader(&controls->m_gain3, tr("Band 3 gain"), 2);
makeFader(&controls->m_gain4, tr("Band 4 gain"), 3);
- const auto muteOn = embed::getIconPixmap("mute_active");
- const auto muteOff = embed::getIconPixmap("mute_inactive");
-
- const auto makeMuteBtn = [this, bandsLayout, muteOn, muteOff](
- BoolModel *model,
- const QString &label,
+ const auto makeMuteBtn = [this, bandsLayout](
+ BoolModel* model,
+ const QString& label,
int column
) {
- auto b = new PixmapButton(this, label);
- b->setActiveGraphic(muteOff);
- b->setInactiveGraphic(muteOn);
+ auto b = new AutomatableButton(this, label);
b->setCheckable(true);
b->setModel(model);
b->setToolTip(label);
+ b->setObjectName("btn-mute-inv");
bandsLayout->addWidget(b, 1, column, Qt::AlignCenter);
};
diff --git a/src/gui/MixerChannelView.cpp b/src/gui/MixerChannelView.cpp
index 1eb2fd1bb..ccfb5c75c 100644
--- a/src/gui/MixerChannelView.cpp
+++ b/src/gui/MixerChannelView.cpp
@@ -107,18 +107,16 @@ MixerChannelView::MixerChannelView(QWidget* parent, MixerView* mixerView, int ch
renameLineEditProxy->setRotation(-90);
m_renameLineEditView->setFixedSize(m_renameLineEdit->height() + 5, m_renameLineEdit->width() + 5);
- m_muteButton = new PixmapButton(this, tr("Mute"));
+ m_muteButton = new AutomatableButton(this, tr("Mute"));
m_muteButton->setModel(&mixerChannel->m_muteModel);
- m_muteButton->setActiveGraphic(embed::getIconPixmap("mute_active"));
- m_muteButton->setInactiveGraphic(embed::getIconPixmap("mute_inactive"));
m_muteButton->setCheckable(true);
+ m_muteButton->setObjectName("btn-mute");
m_muteButton->setToolTip(tr("Mute this channel"));
- m_soloButton = new PixmapButton(this, tr("Solo"));
+ m_soloButton = new AutomatableButton(this, tr("Solo"));
m_soloButton->setModel(&mixerChannel->m_soloModel);
- m_soloButton->setActiveGraphic(embed::getIconPixmap("solo_active"));
- m_soloButton->setInactiveGraphic(embed::getIconPixmap("solo_inactive"));
m_soloButton->setCheckable(true);
+ m_soloButton->setObjectName("btn-solo");
m_soloButton->setToolTip(tr("Solo this channel"));
auto soloMuteLayout = new QVBoxLayout();
diff --git a/src/gui/SampleTrackWindow.cpp b/src/gui/SampleTrackWindow.cpp
index e8bd5970d..eb09a2097 100644
--- a/src/gui/SampleTrackWindow.cpp
+++ b/src/gui/SampleTrackWindow.cpp
@@ -32,7 +32,6 @@
#include
#include "EffectRackView.h"
-#include "PixmapButton.h"
#include "embed.h"
#include "GuiApplication.h"
#include "Knob.h"
@@ -101,18 +100,16 @@ SampleTrackWindow::SampleTrackWindow(SampleTrackView * tv) :
soloMuteLayout->setContentsMargins(0, 0, 2, 0);
soloMuteLayout->setSpacing(2);
- m_muteBtn = new PixmapButton(this, tr("Mute"));
+ m_muteBtn = new AutomatableButton(this, tr("Mute"));
m_muteBtn->setModel(&m_track->m_mutedModel);
- m_muteBtn->setActiveGraphic(embed::getIconPixmap("mute_active"));
- m_muteBtn->setInactiveGraphic(embed::getIconPixmap("mute_inactive"));
+ m_muteBtn->setObjectName("btn-mute");
m_muteBtn->setCheckable(true);
m_muteBtn->setToolTip(tr("Mute this sample track"));
soloMuteLayout->addWidget(m_muteBtn, 0, widgetAlignment);
- m_soloBtn = new PixmapButton(this, tr("Solo"));
+ m_soloBtn = new AutomatableButton(this, tr("Solo"));
m_soloBtn->setModel(&m_track->m_soloModel);
- m_soloBtn->setActiveGraphic(embed::getIconPixmap("solo_active"));
- m_soloBtn->setInactiveGraphic(embed::getIconPixmap("solo_inactive"));
+ m_soloBtn->setObjectName("btn-solo");
m_soloBtn->setCheckable(true);
m_soloBtn->setToolTip(tr("Solo this sample track"));
soloMuteLayout->addWidget(m_soloBtn, 0, widgetAlignment);
diff --git a/src/gui/instrument/InstrumentTrackWindow.cpp b/src/gui/instrument/InstrumentTrackWindow.cpp
index d6c32a205..0446e857e 100644
--- a/src/gui/instrument/InstrumentTrackWindow.cpp
+++ b/src/gui/instrument/InstrumentTrackWindow.cpp
@@ -144,19 +144,17 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
soloMuteLayout->setContentsMargins(0, 0, 2, 0);
soloMuteLayout->setSpacing(2);
- m_muteBtn = new PixmapButton(this, tr("Mute"));
+ m_muteBtn = new AutomatableButton(this, tr("Mute"));
m_muteBtn->setModel(&m_track->m_mutedModel);
- m_muteBtn->setActiveGraphic(embed::getIconPixmap("mute_active"));
- m_muteBtn->setInactiveGraphic(embed::getIconPixmap("mute_inactive"));
m_muteBtn->setCheckable(true);
+ m_muteBtn->setObjectName("btn-mute");
m_muteBtn->setToolTip(tr("Mute this instrument"));
soloMuteLayout->addWidget(m_muteBtn, 0, widgetAlignment);
- m_soloBtn = new PixmapButton(this, tr("Solo"));
+ m_soloBtn = new AutomatableButton(this, tr("Solo"));
m_soloBtn->setModel(&m_track->m_soloModel);
- m_soloBtn->setActiveGraphic(embed::getIconPixmap("solo_active"));
- m_soloBtn->setInactiveGraphic(embed::getIconPixmap("solo_inactive"));
m_soloBtn->setCheckable(true);
+ m_soloBtn->setObjectName("btn-solo");
m_soloBtn->setToolTip(tr("Solo this instrument"));
soloMuteLayout->addWidget(m_soloBtn, 0, widgetAlignment);
diff --git a/src/gui/tracks/TrackOperationsWidget.cpp b/src/gui/tracks/TrackOperationsWidget.cpp
index c43cd022c..238ef8955 100644
--- a/src/gui/tracks/TrackOperationsWidget.cpp
+++ b/src/gui/tracks/TrackOperationsWidget.cpp
@@ -83,7 +83,7 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) :
// buttons in a layout.
auto operationsWidget = new QWidget(this);
auto operationsLayout = new QHBoxLayout(operationsWidget);
- operationsLayout->setContentsMargins(0, 3, 0, 0);
+ operationsLayout->setContentsMargins(2, 6, 0, 6);
operationsLayout->setSpacing(2);
m_trackOps = new QPushButton(operationsWidget);
@@ -91,44 +91,18 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) :
m_trackOps->setMenu( toMenu );
m_trackOps->setToolTip(tr("Actions"));
- // This helper lambda wraps a PixmapButton in a QWidget. This is necessary due to some strange effect where the
- // PixmapButtons are resized to a size that's larger than their minimum/fixed size when the method "show" is called
- // in "TrackContainerView::realignTracks". Specifically, with the default theme the buttons are resized from
- // (16, 14) to (26, 26). This then makes them behave not as expected in layouts.
- // The resizing is not done for QWidgets. Therefore we wrap the PixmapButton in a QWidget which is set to a
- // fixed size that will be able to show the active and inactive pixmap. We can then use the QWidget in layouts
- // without any disturbances.
- //
- // The resizing only seems to affect the track view hierarchy and is triggered by Qt's internal mechanisms.
- // For example the buttons in the mixer view do not seem to be affected.
- // If you want to debug this simply override "PixmapButton::resizeEvent" and trigger a break point in there.
- auto buildPixmapButtonWrappedInWidget = [](QWidget* parent, const QString& toolTip,
- std::string_view activeGraphic, std::string_view inactiveGraphic, PixmapButton*& pixmapButton)
- {
- const auto activePixmap = embed::getIconPixmap(activeGraphic);
- const auto inactivePixmap = embed::getIconPixmap(inactiveGraphic);
-
- auto wrapperWidget = new QWidget(parent);
-
- auto button = new PixmapButton(wrapperWidget, toolTip);
- button->setCheckable(true);
- button->setActiveGraphic(activePixmap);
- button->setInactiveGraphic(inactivePixmap);
- button->setToolTip(toolTip);
-
- wrapperWidget->setFixedSize(button->minimumSizeHint());
-
- pixmapButton = button;
-
- return wrapperWidget;
- };
-
- auto muteWidget = buildPixmapButtonWrappedInWidget(operationsWidget, tr("Mute"), "mute_active", "mute_inactive", m_muteBtn);
- auto soloWidget = buildPixmapButtonWrappedInWidget(operationsWidget, tr("Solo"), "solo_active", "solo_inactive", m_soloBtn);
+ m_muteBtn = new AutomatableButton(operationsWidget, tr("Mute"));
+ m_muteBtn->setCheckable(true);
+ m_muteBtn->setToolTip(tr("Mute"));
+ m_muteBtn->setObjectName("btn-mute");
+ m_soloBtn = new AutomatableButton(operationsWidget, tr("Solo"));
+ m_soloBtn->setCheckable(true);
+ m_soloBtn->setToolTip(tr("Solo"));
+ m_soloBtn->setObjectName("btn-solo");
operationsLayout->addWidget(m_trackOps);
- operationsLayout->addWidget(muteWidget);
- operationsLayout->addWidget(soloWidget);
+ operationsLayout->addWidget(m_muteBtn);
+ operationsLayout->addWidget(m_soloBtn);
layout->addWidget(operationsWidget, 0, Qt::AlignTop | Qt::AlignLeading);