more touchups (#21634)

* wait to hide

* same msg

* networking ui fixups

* clicked

Co-authored-by: Comma Device <device@comma.ai>
pull/21606/head^2
Adeeb Shihadeh 4 years ago committed by GitHub
parent 4f9ac7a1aa
commit 62077abd3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      selfdrive/ui/qt/offroad/networking.cc
  2. 11
      selfdrive/ui/qt/setup/setup.cc

@ -211,7 +211,7 @@ void WifiUI::refresh() {
clearLayout(main_layout); clearLayout(main_layout);
if (wifi->seen_networks.size() == 0) { if (wifi->seen_networks.size() == 0) {
QLabel *scanning = new QLabel("No networks found. Scanning..."); QLabel *scanning = new QLabel("Scanning for networks...");
scanning->setStyleSheet("font-size: 65px;"); scanning->setStyleSheet("font-size: 65px;");
main_layout->addWidget(scanning, 0, Qt::AlignCenter); main_layout->addWidget(scanning, 0, Qt::AlignCenter);
return; return;
@ -221,7 +221,7 @@ void WifiUI::refresh() {
int i = 0; int i = 0;
for (Network &network : wifi->seen_networks) { for (Network &network : wifi->seen_networks) {
QHBoxLayout *hlayout = new QHBoxLayout; QHBoxLayout *hlayout = new QHBoxLayout;
hlayout->setContentsMargins(44, 50, 73, 50); hlayout->setContentsMargins(44, 0, 73, 0);
hlayout->setSpacing(50); hlayout->setSpacing(50);
// Clickable SSID label // Clickable SSID label
@ -235,16 +235,17 @@ void WifiUI::refresh() {
font-weight: %1; font-weight: %1;
text-align: left; text-align: left;
border: none; border: none;
padding: 0; padding-top: 50px;
padding-bottom: 50px;
)").arg(weight)); )").arg(weight));
QObject::connect(ssid_label, &QPushButton::clicked, this, [=]() { emit connectToNetwork(network); }); QObject::connect(ssid_label, &QPushButton::clicked, this, [=]() { emit connectToNetwork(network); });
hlayout->addWidget(ssid_label, 1); hlayout->addWidget(ssid_label, network.connected == ConnectedType::CONNECTING ? 0 : 1);
if (network.connected == ConnectedType::CONNECTING) { if (network.connected == ConnectedType::CONNECTING) {
QPushButton *connecting = new QPushButton("CONNECTING..."); QPushButton *connecting = new QPushButton("CONNECTING...");
connecting->setStyleSheet(R"( connecting->setStyleSheet(R"(
font-size: 32px; font-size: 32px;
font-weight: 500; font-weight: 600;
color: white; color: white;
border-radius: 0; border-radius: 0;
padding: 27px; padding: 27px;
@ -293,5 +294,5 @@ void WifiUI::refresh() {
} }
i++; i++;
} }
main_layout->addStretch(1); main_layout->addStretch(2);
} }

@ -270,7 +270,7 @@ QWidget * Setup::download_failed() {
QPushButton *reboot = new QPushButton("Reboot device"); QPushButton *reboot = new QPushButton("Reboot device");
reboot->setObjectName("navBtn"); reboot->setObjectName("navBtn");
blayout->addWidget(reboot); blayout->addWidget(reboot);
QObject::connect(reboot, &QPushButton::released, this, [=]() { QObject::connect(reboot, &QPushButton::clicked, this, [=]() {
Hardware::reboot(); Hardware::reboot();
}); });
@ -278,7 +278,7 @@ QWidget * Setup::download_failed() {
restart->setObjectName("navBtn"); restart->setObjectName("navBtn");
restart->setProperty("primary", true); restart->setProperty("primary", true);
blayout->addWidget(restart); blayout->addWidget(restart);
QObject::connect(restart, &QPushButton::released, this, [=]() { QObject::connect(restart, &QPushButton::clicked, this, [=]() {
setCurrentIndex(0); setCurrentIndex(0);
}); });
@ -312,8 +312,11 @@ Setup::Setup(QWidget *parent) : QStackedWidget(parent) {
QObject::connect(this, &Setup::finished, [=](bool success) { QObject::connect(this, &Setup::finished, [=](bool success) {
// hide setup on success // hide setup on success
qDebug() << "finished" << success; qDebug() << "finished" << success;
setVisible(!success); if (success) {
setCurrentWidget(failed_widget); QTimer::singleShot(3000, this, &QWidget::hide);
} else {
setCurrentWidget(failed_widget);
}
}); });
// TODO: revisit pressed bg color // TODO: revisit pressed bg color

Loading…
Cancel
Save