diff --git a/selfdrive/ui/qt/offroad/networking.cc b/selfdrive/ui/qt/offroad/networking.cc index d3fdeb89c2..324aee5201 100644 --- a/selfdrive/ui/qt/offroad/networking.cc +++ b/selfdrive/ui/qt/offroad/networking.cc @@ -247,7 +247,7 @@ void WifiUI::refresh() { QPushButton *forgetBtn = new QPushButton("FORGET"); forgetBtn->setObjectName("forgetBtn"); QObject::connect(forgetBtn, &QPushButton::released, [=]() { - if (ConfirmationDialog::confirm("Are you sure you want to forget " + QString::fromUtf8(network.ssid) + "?", this)) { + if (ConfirmationDialog::confirm("Forget WiFi Network \"" + QString::fromUtf8(network.ssid) + "\"?", this)) { wifi->forgetConnection(network.ssid); } }); diff --git a/selfdrive/ui/qt/widgets/input.cc b/selfdrive/ui/qt/widgets/input.cc index 09ee117f50..095967a6ab 100644 --- a/selfdrive/ui/qt/widgets/input.cc +++ b/selfdrive/ui/qt/widgets/input.cc @@ -2,6 +2,7 @@ #include +#include "selfdrive/ui/qt/util.h" #include "selfdrive/ui/qt/qt_window.h" #include "selfdrive/hardware/hw.h" @@ -164,47 +165,56 @@ void InputDialog::setMinLength(int length) { ConfirmationDialog::ConfirmationDialog(const QString &prompt_text, const QString &confirm_text, const QString &cancel_text, QWidget *parent) : QDialogBase(parent) { - setWindowFlags(Qt::Popup); - main_layout = new QVBoxLayout(this); - main_layout->setMargin(25); + QFrame *container = new QFrame(this); + QVBoxLayout *main_layout = new QVBoxLayout(container); + main_layout->setContentsMargins(32, 120, 32, 32); - prompt = new QLabel(prompt_text, this); + QLabel *prompt = new QLabel(prompt_text, this); prompt->setWordWrap(true); prompt->setAlignment(Qt::AlignHCenter); - prompt->setStyleSheet("font-size: 55px; font-weight: 400;"); + prompt->setStyleSheet("font-size: 70px; font-weight: bold; color: black;"); main_layout->addWidget(prompt, 1, Qt::AlignTop | Qt::AlignHCenter); // cancel + confirm buttons QHBoxLayout *btn_layout = new QHBoxLayout(); - btn_layout->setSpacing(20); - btn_layout->addStretch(1); + btn_layout->setSpacing(30); main_layout->addLayout(btn_layout); if (cancel_text.length()) { QPushButton* cancel_btn = new QPushButton(cancel_text); - btn_layout->addWidget(cancel_btn, 0, Qt::AlignRight); + btn_layout->addWidget(cancel_btn); QObject::connect(cancel_btn, &QPushButton::released, this, &ConfirmationDialog::reject); } if (confirm_text.length()) { QPushButton* confirm_btn = new QPushButton(confirm_text); - btn_layout->addWidget(confirm_btn, 0, Qt::AlignRight); + btn_layout->addWidget(confirm_btn); QObject::connect(confirm_btn, &QPushButton::released, this, &ConfirmationDialog::accept); } - setFixedSize(900, 350); + QVBoxLayout *outer_layout = new QVBoxLayout(this); + outer_layout->setContentsMargins(210, 170, 210, 170); + outer_layout->addWidget(container); + + setWindowFlags(Qt::Popup); setStyleSheet(R"( - * { - color: black; - background-color: white; + ConfirmationDialog { + background-color: black; + } + QFrame { + border-radius: 0; + background-color: #ECECEC; } QPushButton { - font-size: 40px; - padding: 30px; - padding-right: 45px; - padding-left: 45px; - border-radius: 7px; - background-color: #44444400; + height: 160; + font-size: 55px; + font-weight: 400; + border-radius: 10px; + color: white; + background-color: #333333; + } + QPushButton:pressed { + background-color: #444444; } )"); } @@ -220,9 +230,6 @@ bool ConfirmationDialog::confirm(const QString &prompt_text, QWidget *parent) { } int ConfirmationDialog::exec() { - // TODO: make this work without fullscreen - if (Hardware::TICI()) { - setMainWindow(this); - } + setMainWindow(this); return QDialog::exec(); } diff --git a/selfdrive/ui/qt/widgets/input.h b/selfdrive/ui/qt/widgets/input.h index fbef7b7e60..adab7178ef 100644 --- a/selfdrive/ui/qt/widgets/input.h +++ b/selfdrive/ui/qt/widgets/input.h @@ -59,10 +59,6 @@ public: static bool alert(const QString &prompt_text, QWidget *parent); static bool confirm(const QString &prompt_text, QWidget *parent); -private: - QLabel *prompt; - QVBoxLayout *main_layout; - public slots: int exec() override; };