diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 142b2aa836..98daa6a764 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -169,7 +169,7 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) { power_layout->setSpacing(30); QPushButton *reboot_btn = new QPushButton("Reboot"); - reboot_btn->setStyleSheet("height: 120px;border-radius: 15px; background-color: #393939;"); + reboot_btn->setObjectName("reboot_btn"); power_layout->addWidget(reboot_btn); QObject::connect(reboot_btn, &QPushButton::clicked, [=]() { if (ConfirmationDialog::confirm("Are you sure you want to reboot?", this)) { @@ -178,7 +178,7 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) { }); QPushButton *poweroff_btn = new QPushButton("Power Off"); - poweroff_btn->setStyleSheet("height: 120px;border-radius: 15px; background-color: #E22C2C;"); + poweroff_btn->setObjectName("poweroff_btn"); power_layout->addWidget(poweroff_btn); QObject::connect(poweroff_btn, &QPushButton::clicked, [=]() { if (ConfirmationDialog::confirm("Are you sure you want to power off?", this)) { @@ -186,6 +186,16 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) { } }); + setStyleSheet(R"( + QPushButton { + height: 120px; + border-radius: 15px; + } + #reboot_btn { background-color: #393939; } + #reboot_btn:pressed { background-color: #4a4a4a; } + #poweroff_btn { background-color: #E22C2C; } + #poweroff_btn:pressed { background-color: #FF2424; } + )"); main_layout->addLayout(power_layout); } @@ -298,13 +308,18 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) { // close button QPushButton *close_btn = new QPushButton("×"); close_btn->setStyleSheet(R"( - font-size: 140px; - padding-bottom: 20px; - font-weight: bold; - border 1px grey solid; - border-radius: 100px; - background-color: #292929; - font-weight: 400; + QPushButton { + font-size: 140px; + padding-bottom: 20px; + font-weight: bold; + border 1px grey solid; + border-radius: 100px; + background-color: #292929; + font-weight: 400; + } + QPushButton:pressed { + background-color: #3B3B3B; + } )"); close_btn->setFixedSize(200, 200); sidebar_layout->addSpacing(45); @@ -349,6 +364,9 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) { QPushButton:checked { color: white; } + QPushButton:pressed { + color: #ADADAD; + } )").arg(padding)); nav_btns->addButton(btn); diff --git a/selfdrive/ui/qt/widgets/controls.cc b/selfdrive/ui/qt/widgets/controls.cc index cd844794e1..2087977d05 100644 --- a/selfdrive/ui/qt/widgets/controls.cc +++ b/selfdrive/ui/qt/widgets/controls.cc @@ -78,6 +78,9 @@ ButtonControl::ButtonControl(const QString &title, const QString &text, const QS color: #E4E4E4; background-color: #393939; } + QPushButton:pressed { + background-color: #4a4a4a; + } QPushButton:disabled { color: #33E4E4E4; }