DevicePanel: set specific stylesheet for reboot & poweroff buttons (#21364)

* set specific stylesheet for reboot&poweroff buttons

* remove hack

* fix css in network panel
pull/21371/head
Dean Lee 4 years ago committed by GitHub
parent 2e3aa81ce5
commit c9d4dfe99f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      selfdrive/ui/qt/offroad/networking.cc
  2. 12
      selfdrive/ui/qt/offroad/settings.cc
  3. 2
      selfdrive/ui/qt/widgets/controls.cc

@ -53,6 +53,7 @@ void Networking::attemptInitialization() {
QVBoxLayout* vlayout = new QVBoxLayout(wifiScreen);
if (show_advanced) {
QPushButton* advancedSettings = new QPushButton("Advanced");
advancedSettings->setObjectName("advancedBtn");
advancedSettings->setStyleSheet("margin-right: 30px;");
advancedSettings->setFixedSize(350, 100);
connect(advancedSettings, &QPushButton::released, [=]() { main_layout->setCurrentWidget(an); });
@ -62,6 +63,7 @@ void Networking::attemptInitialization() {
}
wifiWidget = new WifiUI(this, wifi);
wifiWidget->setObjectName("wifiWidget");
connect(wifiWidget, &WifiUI::connectToNetwork, this, &Networking::connectToNetwork);
vlayout->addWidget(new ScrollView(wifiWidget, this), 1);
@ -72,7 +74,7 @@ void Networking::attemptInitialization() {
main_layout->addWidget(an);
setStyleSheet(R"(
QPushButton {
#wifiWidget > QPushButton, #back_btn, #advancedBtn {
font-size: 50px;
margin: 0px;
padding: 15px;
@ -81,7 +83,7 @@ void Networking::attemptInitialization() {
color: #dddddd;
background-color: #444444;
}
QPushButton:disabled {
#wifiWidget > QPushButton:disabled {
color: #777777;
background-color: #222222;
}
@ -140,6 +142,7 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid
// Back button
QPushButton* back = new QPushButton("Back");
back->setObjectName("back_btn");
back->setFixedSize(500, 100);
connect(back, &QPushButton::released, [=]() { emit backPress(); });
main_layout->addWidget(back, 0, Qt::AlignLeft);

@ -178,6 +178,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;");
power_layout->addWidget(reboot_btn);
QObject::connect(reboot_btn, &QPushButton::released, [=]() {
if (ConfirmationDialog::confirm("Are you sure you want to reboot?", this)) {
@ -186,7 +187,7 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) {
});
QPushButton *poweroff_btn = new QPushButton("Power Off");
poweroff_btn->setStyleSheet("background-color: #E22C2C;");
poweroff_btn->setStyleSheet("height: 120px;border-radius: 15px;background-color: #E22C2C;");
power_layout->addWidget(poweroff_btn);
QObject::connect(poweroff_btn, &QPushButton::released, [=]() {
if (ConfirmationDialog::confirm("Are you sure you want to power off?", this)) {
@ -195,15 +196,6 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) {
});
main_layout->addLayout(power_layout);
setStyleSheet(R"(
QPushButton {
padding: 0;
height: 120px;
border-radius: 15px;
background-color: #393939;
}
)");
}
SoftwarePanel::SoftwarePanel(QWidget* parent) : QWidget(parent) {

@ -54,8 +54,6 @@ AbstractControl::AbstractControl(const QString &title, const QString &desc, cons
description->setVisible(!description->isVisible());
});
}
setStyleSheet("background-color: transparent;");
}
void AbstractControl::hideEvent(QHideEvent *e) {

Loading…
Cancel
Save