From e2eb4034f56f89e166f033389a9f99e8c7c4d3bc Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 22 Mar 2021 04:03:11 -0700 Subject: [PATCH] small style improvement in settings old-commit-hash: 647c5804b8e8fc4cc0c43ec32d60ea0468ddb4df --- selfdrive/ui/qt/offroad/settings.cc | 22 +++++++++++++--------- selfdrive/ui/qt/widgets/controls.hpp | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 6e4ade8c99..1a204c2466 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -110,9 +110,21 @@ QWidget * device_panel() { } })); + device_layout->addWidget(horizontal_line()); + + QString brand = params.read_db_bool("Passive") ? "dashcam" : "openpilot"; + device_layout->addWidget(new ButtonControl("Uninstall " + brand, "UNINSTALL", + "", + [=]() { + if (ConfirmationDialog::confirm("Are you srue you want to uninstall?")) { + Params().write_db_value("DoUninstall", "1"); + } + })); + // power buttons QPushButton *poweroff_btn = new QPushButton("Power Off"); + poweroff_btn->setStyleSheet("background-color: #E22C2C;"); device_layout->addWidget(poweroff_btn, Qt::AlignBottom); QObject::connect(poweroff_btn, &QPushButton::released, [=]() { if (ConfirmationDialog::confirm("Are you sure you want to power off?")) { @@ -120,7 +132,7 @@ QWidget * device_panel() { } }); - device_layout->addWidget(horizontal_line(), Qt::AlignBottom); + device_layout->addSpacing(20); QPushButton *reboot_btn = new QPushButton("Reboot"); device_layout->addWidget(reboot_btn, Qt::AlignBottom); @@ -130,14 +142,6 @@ QWidget * device_panel() { } }); - QPushButton *uninstall_btn = new QPushButton("Uninstall openpilot"); - device_layout->addWidget(uninstall_btn); - QObject::connect(uninstall_btn, &QPushButton::released, [=]() { - if (ConfirmationDialog::confirm("Are you sure you want to uninstall?")) { - Params().write_db_value("DoUninstall", "1"); - } - }); - QWidget *widget = new QWidget; widget->setLayout(device_layout); widget->setStyleSheet(R"( diff --git a/selfdrive/ui/qt/widgets/controls.hpp b/selfdrive/ui/qt/widgets/controls.hpp index 33f0e165ca..3fe9251107 100644 --- a/selfdrive/ui/qt/widgets/controls.hpp +++ b/selfdrive/ui/qt/widgets/controls.hpp @@ -54,7 +54,7 @@ public: btn.setStyleSheet(R"( padding: 0; border-radius: 50px; - font-size: 40px; + font-size: 35px; font-weight: 500; color: #E4E4E4; background-color: #393939;