UI: add missing QPushButton pressed styles (#28289)

* UI: add missing QPushButton pressed styles

* keyboard is special
pull/28299/head
Cameron Clough 2 years ago committed by GitHub
parent 2bd37acef3
commit 488975f06e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      selfdrive/ui/qt/offroad/onboarding.cc
  2. 12
      selfdrive/ui/qt/setup/reset.cc
  3. 12
      selfdrive/ui/qt/setup/updater.cc
  4. 13
      selfdrive/ui/qt/widgets/input.cc
  5. 9
      selfdrive/ui/qt/widgets/keyboard.cc

@ -111,6 +111,9 @@ void TermsPage::showEvent(QShowEvent *event) {
QPushButton { QPushButton {
background-color: #465BEA; background-color: #465BEA;
} }
QPushButton:pressed {
background-color: #3049F4;
}
QPushButton:disabled { QPushButton:disabled {
background-color: #4F4F4F; background-color: #4F4F4F;
} }

@ -79,7 +79,14 @@ Reset::Reset(ResetMode mode, QWidget *parent) : QWidget(parent) {
#endif #endif
confirmBtn = new QPushButton(tr("Confirm")); confirmBtn = new QPushButton(tr("Confirm"));
confirmBtn->setStyleSheet("background-color: #465BEA;"); confirmBtn->setStyleSheet(R"(
QPushButton {
background-color: #465BEA;
}
QPushButton:pressed {
background-color: #3049F4;
}
)");
blayout->addWidget(confirmBtn); blayout->addWidget(confirmBtn);
QObject::connect(confirmBtn, &QPushButton::clicked, this, &Reset::confirm); QObject::connect(confirmBtn, &QPushButton::clicked, this, &Reset::confirm);
@ -111,6 +118,9 @@ Reset::Reset(ResetMode mode, QWidget *parent) : QWidget(parent) {
border-radius: 10px; border-radius: 10px;
background-color: #333333; background-color: #333333;
} }
QPushButton:pressed {
background-color: #444444;
}
)"); )");
} }

@ -46,7 +46,14 @@ Updater::Updater(const QString &updater_path, const QString &manifest_path, QWid
QPushButton *install = new QPushButton(tr("Install")); QPushButton *install = new QPushButton(tr("Install"));
install->setObjectName("navBtn"); install->setObjectName("navBtn");
install->setStyleSheet("background-color: #465BEA;"); install->setStyleSheet(R"(
QPushButton {
background-color: #465BEA;
}
QPushButton:pressed {
background-color: #3049F4;
}
)");
QObject::connect(install, &QPushButton::clicked, this, &Updater::installUpdate); QObject::connect(install, &QPushButton::clicked, this, &Updater::installUpdate);
hlayout->addWidget(install); hlayout->addWidget(install);
} }
@ -124,6 +131,9 @@ Updater::Updater(const QString &updater_path, const QString &manifest_path, QWid
border-radius: 10px; border-radius: 10px;
background-color: #333333; background-color: #333333;
} }
QPushButton#navBtn:pressed {
background-color: #444444;
}
QProgressBar { QProgressBar {
border: none; border: none;
background-color: #292929; background-color: #292929;

@ -71,10 +71,15 @@ InputDialog::InputDialog(const QString &title, QWidget *parent, const QString &s
QPushButton* cancel_btn = new QPushButton(tr("Cancel")); QPushButton* cancel_btn = new QPushButton(tr("Cancel"));
cancel_btn->setFixedSize(386, 125); cancel_btn->setFixedSize(386, 125);
cancel_btn->setStyleSheet(R"( cancel_btn->setStyleSheet(R"(
font-size: 48px; QPushButton {
border-radius: 10px; font-size: 48px;
color: #E4E4E4; border-radius: 10px;
background-color: #444444; color: #E4E4E4;
background-color: #333333;
}
QPushButton:pressed {
background-color: #444444;
}
)"); )");
header_layout->addWidget(cancel_btn, 0, Qt::AlignRight); header_layout->addWidget(cancel_btn, 0, Qt::AlignRight);
QObject::connect(cancel_btn, &QPushButton::clicked, this, &InputDialog::reject); QObject::connect(cancel_btn, &QPushButton::clicked, this, &InputDialog::reject);

@ -59,7 +59,14 @@ KeyboardLayout::KeyboardLayout(QWidget* parent, const std::vector<QVector<QStrin
if (p == BACKSPACE_KEY) { if (p == BACKSPACE_KEY) {
btn->setAutoRepeat(true); btn->setAutoRepeat(true);
} else if (p == ENTER_KEY) { } else if (p == ENTER_KEY) {
btn->setStyleSheet("background-color: #465BEA;"); btn->setStyleSheet(R"(
QPushButton {
background-color: #465BEA;
}
QPushButton:pressed {
background-color: #444444;
}
)");
} }
btn->setFixedHeight(135 + key_spacing_vertical); btn->setFixedHeight(135 + key_spacing_vertical);
btn_group->addButton(btn); btn_group->addButton(btn);

Loading…
Cancel
Save