From 2eefd0aaf5f981e5a9f7e0b6429205a924707613 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 18 Jan 2025 21:12:19 -0500 Subject: [PATCH 1/8] visuals for DEC --- selfdrive/ui/qt/onroad/buttons.cc | 20 ++++++++++++++++++-- selfdrive/ui/qt/onroad/buttons.h | 1 + selfdrive/ui/sunnypilot/ui.cc | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/selfdrive/ui/qt/onroad/buttons.cc b/selfdrive/ui/qt/onroad/buttons.cc index 2c2cc672b9..2b2c621124 100644 --- a/selfdrive/ui/qt/onroad/buttons.cc +++ b/selfdrive/ui/qt/onroad/buttons.cc @@ -34,16 +34,32 @@ void ExperimentalButton::changeMode() { void ExperimentalButton::updateState(const UIState &s) { const auto cs = (*s.sm)["selfdriveState"].getSelfdriveState(); + const auto long_plan_sp = (*s.sm)["longitudinalPlanSP"].getLongitudinalPlanSP(); bool eng = cs.getEngageable() || cs.getEnabled(); if ((cs.getExperimentalMode() != experimental_mode) || (eng != engageable)) { engageable = eng; experimental_mode = cs.getExperimentalMode(); update(); } + + if (long_plan_sp.getDec().getEnabled() != dynamic_experimental_control) { + dynamic_experimental_control = long_plan_sp.getDec().getEnabled(); + update(); + } } void ExperimentalButton::paintEvent(QPaintEvent *event) { QPainter p(this); - QPixmap img = experimental_mode ? experimental_img : engage_img; - drawIcon(p, QPoint(btn_size / 2, btn_size / 2), img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); + if (dynamic_experimental_control) { + QRect leftRect(0, 0, btn_size / 2, btn_size); + QRect rightRect(btn_size / 2, 0, btn_size / 2, btn_size); + + p.setOpacity((isDown() || !engageable) ? 0.6 : 1.0); + p.drawPixmap(leftRect, engage_img); + + p.drawPixmap(rightRect, experimental_img); + } else { + QPixmap img = experimental_mode ? experimental_img : engage_img; + drawIcon(p, QPoint(btn_size / 2, btn_size / 2), img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); + } } diff --git a/selfdrive/ui/qt/onroad/buttons.h b/selfdrive/ui/qt/onroad/buttons.h index 3afaed33f4..3b443e073d 100644 --- a/selfdrive/ui/qt/onroad/buttons.h +++ b/selfdrive/ui/qt/onroad/buttons.h @@ -27,6 +27,7 @@ private: QPixmap experimental_img; bool experimental_mode; bool engageable; + bool dynamic_experimental_control; }; void drawIcon(QPainter &p, const QPoint ¢er, const QPixmap &img, const QBrush &bg, float opacity); diff --git a/selfdrive/ui/sunnypilot/ui.cc b/selfdrive/ui/sunnypilot/ui.cc index b27c839805..37da83949b 100644 --- a/selfdrive/ui/sunnypilot/ui.cc +++ b/selfdrive/ui/sunnypilot/ui.cc @@ -18,7 +18,7 @@ UIStateSP::UIStateSP(QObject *parent) : UIState(parent) { "modelV2", "controlsState", "liveCalibration", "radarState", "deviceState", "pandaStates", "carParams", "driverMonitoringState", "carState", "driverStateV2", "wideRoadCameraState", "managerState", "selfdriveState", "longitudinalPlan", - "modelManagerSP", "selfdriveStateSP", + "modelManagerSP", "selfdriveStateSP", "longitudinalPlanSP", }); // update timer From dc45d3043cdccc8e5c3ee3f8908338cc0c39953c Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 18 Jan 2025 21:22:55 -0500 Subject: [PATCH 2/8] try this --- selfdrive/ui/qt/onroad/buttons.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/selfdrive/ui/qt/onroad/buttons.cc b/selfdrive/ui/qt/onroad/buttons.cc index 2b2c621124..de46e686c7 100644 --- a/selfdrive/ui/qt/onroad/buttons.cc +++ b/selfdrive/ui/qt/onroad/buttons.cc @@ -51,13 +51,18 @@ void ExperimentalButton::updateState(const UIState &s) { void ExperimentalButton::paintEvent(QPaintEvent *event) { QPainter p(this); if (dynamic_experimental_control) { - QRect leftRect(0, 0, btn_size / 2, btn_size); - QRect rightRect(btn_size / 2, 0, btn_size / 2, btn_size); + QPixmap left_half = engage_img.copy(0, 0, engage_img.width() / 2, engage_img.height()); + QPixmap right_half = experimental_img.copy(experimental_img.width() / 2, 0, experimental_img.width() / 2, experimental_img.height()); - p.setOpacity((isDown() || !engageable) ? 0.6 : 1.0); - p.drawPixmap(leftRect, engage_img); + QPixmap combined_img(engage_img.width(), engage_img.height()); + combined_img.fill(Qt::transparent); - p.drawPixmap(rightRect, experimental_img); + QPainter combined_painter(&combined_img); + combined_painter.drawPixmap(0, 0, left_half); + combined_painter.drawPixmap(engage_img.width() / 2, 0, right_half); + combined_painter.end(); + + drawIcon(p, QPoint(btn_size / 2, btn_size / 2), combined_img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); } else { QPixmap img = experimental_mode ? experimental_img : engage_img; drawIcon(p, QPoint(btn_size / 2, btn_size / 2), img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); From 0737f311b85959babd33e34fcf72fd696fcd33c3 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 18 Jan 2025 21:31:01 -0500 Subject: [PATCH 3/8] add opacity --- selfdrive/ui/qt/onroad/buttons.cc | 9 ++++++++- selfdrive/ui/qt/onroad/buttons.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/onroad/buttons.cc b/selfdrive/ui/qt/onroad/buttons.cc index de46e686c7..83fab48735 100644 --- a/selfdrive/ui/qt/onroad/buttons.cc +++ b/selfdrive/ui/qt/onroad/buttons.cc @@ -42,8 +42,10 @@ void ExperimentalButton::updateState(const UIState &s) { update(); } - if (long_plan_sp.getDec().getEnabled() != dynamic_experimental_control) { + int mode = int(long_plan_sp.getDec().getState()); + if ((long_plan_sp.getDec().getEnabled() != dynamic_experimental_control) || (mode != dec_mpc_mode)) { dynamic_experimental_control = long_plan_sp.getDec().getEnabled(); + dec_mpc_mode = mode; update(); } } @@ -58,8 +60,13 @@ void ExperimentalButton::paintEvent(QPaintEvent *event) { combined_img.fill(Qt::transparent); QPainter combined_painter(&combined_img); + + combined_painter.setOpacity(dec_mpc_mode == 1 ? 0.6 : 1.0); combined_painter.drawPixmap(0, 0, left_half); + + combined_painter.setOpacity(dec_mpc_mode == 1 ? 1.0 : 0.6); combined_painter.drawPixmap(engage_img.width() / 2, 0, right_half); + combined_painter.end(); drawIcon(p, QPoint(btn_size / 2, btn_size / 2), combined_img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); diff --git a/selfdrive/ui/qt/onroad/buttons.h b/selfdrive/ui/qt/onroad/buttons.h index 3b443e073d..77f85e60b4 100644 --- a/selfdrive/ui/qt/onroad/buttons.h +++ b/selfdrive/ui/qt/onroad/buttons.h @@ -28,6 +28,7 @@ private: bool experimental_mode; bool engageable; bool dynamic_experimental_control; + int dec_mpc_mode; }; void drawIcon(QPainter &p, const QPoint ¢er, const QPixmap &img, const QBrush &bg, float opacity); From a9ca9bbdf8bcf03335580bdd8ebeeb2181ec63d8 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 18 Jan 2025 21:35:27 -0500 Subject: [PATCH 4/8] should be active and dimmer --- selfdrive/ui/qt/onroad/buttons.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/ui/qt/onroad/buttons.cc b/selfdrive/ui/qt/onroad/buttons.cc index 83fab48735..334f6dad74 100644 --- a/selfdrive/ui/qt/onroad/buttons.cc +++ b/selfdrive/ui/qt/onroad/buttons.cc @@ -43,8 +43,8 @@ void ExperimentalButton::updateState(const UIState &s) { } int mode = int(long_plan_sp.getDec().getState()); - if ((long_plan_sp.getDec().getEnabled() != dynamic_experimental_control) || (mode != dec_mpc_mode)) { - dynamic_experimental_control = long_plan_sp.getDec().getEnabled(); + if ((long_plan_sp.getDec().getActive() != dynamic_experimental_control) || (mode != dec_mpc_mode)) { + dynamic_experimental_control = long_plan_sp.getDec().getActive(); dec_mpc_mode = mode; update(); } @@ -61,10 +61,10 @@ void ExperimentalButton::paintEvent(QPaintEvent *event) { QPainter combined_painter(&combined_img); - combined_painter.setOpacity(dec_mpc_mode == 1 ? 0.6 : 1.0); + combined_painter.setOpacity(dec_mpc_mode == 1 ? 0.2 : 1.0); combined_painter.drawPixmap(0, 0, left_half); - combined_painter.setOpacity(dec_mpc_mode == 1 ? 1.0 : 0.6); + combined_painter.setOpacity(dec_mpc_mode == 1 ? 1.0 : 0.2); combined_painter.drawPixmap(engage_img.width() / 2, 0, right_half); combined_painter.end(); From 3d35164287211e06ef44ece1118760369b4106c3 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 18 Jan 2025 21:43:14 -0500 Subject: [PATCH 5/8] even dimmer --- selfdrive/ui/qt/onroad/buttons.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/ui/qt/onroad/buttons.cc b/selfdrive/ui/qt/onroad/buttons.cc index 334f6dad74..aa25856fca 100644 --- a/selfdrive/ui/qt/onroad/buttons.cc +++ b/selfdrive/ui/qt/onroad/buttons.cc @@ -61,10 +61,10 @@ void ExperimentalButton::paintEvent(QPaintEvent *event) { QPainter combined_painter(&combined_img); - combined_painter.setOpacity(dec_mpc_mode == 1 ? 0.2 : 1.0); + combined_painter.setOpacity(dec_mpc_mode == 1 ? 0.1 : 1.0); combined_painter.drawPixmap(0, 0, left_half); - combined_painter.setOpacity(dec_mpc_mode == 1 ? 1.0 : 0.2); + combined_painter.setOpacity(dec_mpc_mode == 1 ? 1.0 : 0.1); combined_painter.drawPixmap(engage_img.width() / 2, 0, right_half); combined_painter.end(); From 19b96003dc954658d73849b2cc437031b0d3a129 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 18 Jan 2025 21:51:49 -0500 Subject: [PATCH 6/8] use another method for drawing --- selfdrive/ui/qt/onroad/buttons.cc | 4 ++++ selfdrive/ui/qt/onroad/buttons.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/onroad/buttons.cc b/selfdrive/ui/qt/onroad/buttons.cc index aa25856fca..b05c3ed7e9 100644 --- a/selfdrive/ui/qt/onroad/buttons.cc +++ b/selfdrive/ui/qt/onroad/buttons.cc @@ -52,6 +52,10 @@ void ExperimentalButton::updateState(const UIState &s) { void ExperimentalButton::paintEvent(QPaintEvent *event) { QPainter p(this); + drawButton(p); +} + +void ExperimentalButton::drawButton(QPainter &p) { if (dynamic_experimental_control) { QPixmap left_half = engage_img.copy(0, 0, engage_img.width() / 2, engage_img.height()); QPixmap right_half = experimental_img.copy(experimental_img.width() / 2, 0, experimental_img.width() / 2, experimental_img.height()); diff --git a/selfdrive/ui/qt/onroad/buttons.h b/selfdrive/ui/qt/onroad/buttons.h index 77f85e60b4..3cc33caaaf 100644 --- a/selfdrive/ui/qt/onroad/buttons.h +++ b/selfdrive/ui/qt/onroad/buttons.h @@ -16,11 +16,12 @@ class ExperimentalButton : public QPushButton { public: explicit ExperimentalButton(QWidget *parent = 0); - void updateState(const UIState &s); + virtual void updateState(const UIState &s); private: void paintEvent(QPaintEvent *event) override; void changeMode(); + virtual void drawButton(QPainter &p); Params params; QPixmap engage_img; From bf0a7b4494673bcdfccb6af3d19d3f0c3ad8bb74 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 18 Jan 2025 22:02:40 -0500 Subject: [PATCH 7/8] migrate to sp only --- selfdrive/ui/qt/onroad/annotated_camera.h | 4 +- selfdrive/ui/qt/onroad/buttons.cc | 32 +------------ selfdrive/ui/qt/onroad/buttons.h | 7 +-- selfdrive/ui/sunnypilot/SConscript | 1 + selfdrive/ui/sunnypilot/qt/onroad/buttons.cc | 50 ++++++++++++++++++++ selfdrive/ui/sunnypilot/qt/onroad/buttons.h | 24 ++++++++++ 6 files changed, 84 insertions(+), 34 deletions(-) create mode 100644 selfdrive/ui/sunnypilot/qt/onroad/buttons.cc create mode 100644 selfdrive/ui/sunnypilot/qt/onroad/buttons.h diff --git a/selfdrive/ui/qt/onroad/annotated_camera.h b/selfdrive/ui/qt/onroad/annotated_camera.h index a161b89ee3..219b39546f 100644 --- a/selfdrive/ui/qt/onroad/annotated_camera.h +++ b/selfdrive/ui/qt/onroad/annotated_camera.h @@ -2,14 +2,16 @@ #include #include -#include "selfdrive/ui/qt/onroad/buttons.h" #include "selfdrive/ui/qt/onroad/driver_monitoring.h" #include "selfdrive/ui/qt/onroad/model.h" #include "selfdrive/ui/qt/widgets/cameraview.h" #ifdef SUNNYPILOT +#include "selfdrive/ui/sunnypilot/qt/onroad/buttons.h" #include "selfdrive/ui/sunnypilot/qt/onroad/hud.h" +#define ExperimentalButton ExperimentalButtonSP #else +#include "selfdrive/ui/qt/onroad/buttons.h" #include "selfdrive/ui/qt/onroad/hud.h" #endif diff --git a/selfdrive/ui/qt/onroad/buttons.cc b/selfdrive/ui/qt/onroad/buttons.cc index b05c3ed7e9..94f042c406 100644 --- a/selfdrive/ui/qt/onroad/buttons.cc +++ b/selfdrive/ui/qt/onroad/buttons.cc @@ -34,20 +34,12 @@ void ExperimentalButton::changeMode() { void ExperimentalButton::updateState(const UIState &s) { const auto cs = (*s.sm)["selfdriveState"].getSelfdriveState(); - const auto long_plan_sp = (*s.sm)["longitudinalPlanSP"].getLongitudinalPlanSP(); bool eng = cs.getEngageable() || cs.getEnabled(); if ((cs.getExperimentalMode() != experimental_mode) || (eng != engageable)) { engageable = eng; experimental_mode = cs.getExperimentalMode(); update(); } - - int mode = int(long_plan_sp.getDec().getState()); - if ((long_plan_sp.getDec().getActive() != dynamic_experimental_control) || (mode != dec_mpc_mode)) { - dynamic_experimental_control = long_plan_sp.getDec().getActive(); - dec_mpc_mode = mode; - update(); - } } void ExperimentalButton::paintEvent(QPaintEvent *event) { @@ -56,26 +48,6 @@ void ExperimentalButton::paintEvent(QPaintEvent *event) { } void ExperimentalButton::drawButton(QPainter &p) { - if (dynamic_experimental_control) { - QPixmap left_half = engage_img.copy(0, 0, engage_img.width() / 2, engage_img.height()); - QPixmap right_half = experimental_img.copy(experimental_img.width() / 2, 0, experimental_img.width() / 2, experimental_img.height()); - - QPixmap combined_img(engage_img.width(), engage_img.height()); - combined_img.fill(Qt::transparent); - - QPainter combined_painter(&combined_img); - - combined_painter.setOpacity(dec_mpc_mode == 1 ? 0.1 : 1.0); - combined_painter.drawPixmap(0, 0, left_half); - - combined_painter.setOpacity(dec_mpc_mode == 1 ? 1.0 : 0.1); - combined_painter.drawPixmap(engage_img.width() / 2, 0, right_half); - - combined_painter.end(); - - drawIcon(p, QPoint(btn_size / 2, btn_size / 2), combined_img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); - } else { - QPixmap img = experimental_mode ? experimental_img : engage_img; - drawIcon(p, QPoint(btn_size / 2, btn_size / 2), img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); - } + QPixmap img = experimental_mode ? experimental_img : engage_img; + drawIcon(p, QPoint(btn_size / 2, btn_size / 2), img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); } diff --git a/selfdrive/ui/qt/onroad/buttons.h b/selfdrive/ui/qt/onroad/buttons.h index 3cc33caaaf..fca909f9b2 100644 --- a/selfdrive/ui/qt/onroad/buttons.h +++ b/selfdrive/ui/qt/onroad/buttons.h @@ -21,15 +21,16 @@ public: private: void paintEvent(QPaintEvent *event) override; void changeMode(); - virtual void drawButton(QPainter &p); Params params; + +protected: + virtual void drawButton(QPainter &p); + QPixmap engage_img; QPixmap experimental_img; bool experimental_mode; bool engageable; - bool dynamic_experimental_control; - int dec_mpc_mode; }; void drawIcon(QPainter &p, const QPoint ¢er, const QPixmap &img, const QBrush &bg, float opacity); diff --git a/selfdrive/ui/sunnypilot/SConscript b/selfdrive/ui/sunnypilot/SConscript index 821801e5a7..629d014b70 100644 --- a/selfdrive/ui/sunnypilot/SConscript +++ b/selfdrive/ui/sunnypilot/SConscript @@ -23,6 +23,7 @@ qt_src = [ "sunnypilot/qt/offroad/settings/sunnypilot_panel.cc", "sunnypilot/qt/offroad/settings/trips_panel.cc", "sunnypilot/qt/onroad/annotated_camera.cc", + "sunnypilot/qt/onroad/buttons.cc", "sunnypilot/qt/onroad/hud.cc", "sunnypilot/qt/onroad/model.cc", "sunnypilot/qt/onroad/onroad_home.cc", diff --git a/selfdrive/ui/sunnypilot/qt/onroad/buttons.cc b/selfdrive/ui/sunnypilot/qt/onroad/buttons.cc new file mode 100644 index 0000000000..8d4ff58d0d --- /dev/null +++ b/selfdrive/ui/sunnypilot/qt/onroad/buttons.cc @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. + * + * This file is part of sunnypilot and is licensed under the MIT License. + * See the LICENSE.md file in the root directory for more details. + */ + +#include "selfdrive/ui/sunnypilot/qt/onroad/buttons.h" + +#include + +ExperimentalButtonSP::ExperimentalButtonSP(QWidget *parent) : ExperimentalButton(parent) { + QObject::disconnect(uiState(), &UIState::uiUpdate, this, &ExperimentalButton::updateState); + QObject::connect(uiState(), &UIState::uiUpdate, this, &ExperimentalButtonSP::updateState); +} + +void ExperimentalButtonSP::updateState(const UIState &s) { + ExperimentalButton::updateState(s); + const auto long_plan_sp = (*s.sm)["longitudinalPlanSP"].getLongitudinalPlanSP(); + + int mode = int(long_plan_sp.getDec().getState()); + if ((long_plan_sp.getDec().getActive() != dynamic_experimental_control) || (mode != dec_mpc_mode)) { + dynamic_experimental_control = long_plan_sp.getDec().getActive(); + dec_mpc_mode = mode; + update(); + } +} + +void ExperimentalButtonSP::drawButton(QPainter &p) { + ExperimentalButton::drawButton(p); + if (dynamic_experimental_control) { + QPixmap left_half = engage_img.copy(0, 0, engage_img.width() / 2, engage_img.height()); + QPixmap right_half = experimental_img.copy(experimental_img.width() / 2, 0, experimental_img.width() / 2, experimental_img.height()); + + QPixmap combined_img(engage_img.width(), engage_img.height()); + combined_img.fill(Qt::transparent); + + QPainter combined_painter(&combined_img); + + combined_painter.setOpacity(dec_mpc_mode == 1 ? 0.1 : 1.0); + combined_painter.drawPixmap(0, 0, left_half); + + combined_painter.setOpacity(dec_mpc_mode == 1 ? 1.0 : 0.1); + combined_painter.drawPixmap(engage_img.width() / 2, 0, right_half); + + combined_painter.end(); + + drawIcon(p, QPoint(btn_size / 2, btn_size / 2), combined_img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); + } +} diff --git a/selfdrive/ui/sunnypilot/qt/onroad/buttons.h b/selfdrive/ui/sunnypilot/qt/onroad/buttons.h new file mode 100644 index 0000000000..ce62a69e2d --- /dev/null +++ b/selfdrive/ui/sunnypilot/qt/onroad/buttons.h @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. + * + * This file is part of sunnypilot and is licensed under the MIT License. + * See the LICENSE.md file in the root directory for more details. + */ + +#pragma once + +#include "selfdrive/ui/qt/onroad/buttons.h" + +class ExperimentalButtonSP : public ExperimentalButton { + Q_OBJECT + +public: + explicit ExperimentalButtonSP(QWidget *parent = nullptr); + void updateState(const UIState &s) override; + +private: + void drawButton(QPainter &p) override; + + bool dynamic_experimental_control; + int dec_mpc_mode; +}; From f2edd589babfd5da9f50e1420f9e8831ef854873 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 18 Jan 2025 22:04:30 -0500 Subject: [PATCH 8/8] fix --- selfdrive/ui/sunnypilot/qt/onroad/buttons.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/sunnypilot/qt/onroad/buttons.cc b/selfdrive/ui/sunnypilot/qt/onroad/buttons.cc index 8d4ff58d0d..97f6a391ce 100644 --- a/selfdrive/ui/sunnypilot/qt/onroad/buttons.cc +++ b/selfdrive/ui/sunnypilot/qt/onroad/buttons.cc @@ -27,7 +27,6 @@ void ExperimentalButtonSP::updateState(const UIState &s) { } void ExperimentalButtonSP::drawButton(QPainter &p) { - ExperimentalButton::drawButton(p); if (dynamic_experimental_control) { QPixmap left_half = engage_img.copy(0, 0, engage_img.width() / 2, engage_img.height()); QPixmap right_half = experimental_img.copy(experimental_img.width() / 2, 0, experimental_img.width() / 2, experimental_img.height()); @@ -46,5 +45,7 @@ void ExperimentalButtonSP::drawButton(QPainter &p) { combined_painter.end(); drawIcon(p, QPoint(btn_size / 2, btn_size / 2), combined_img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); + } else { + ExperimentalButton::drawButton(p); } }