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);
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;");
main_layout->addWidget(scanning, 0, Qt::AlignCenter);
return;
@ -221,7 +221,7 @@ void WifiUI::refresh() {
int i = 0;
for (Network &network : wifi->seen_networks) {
QHBoxLayout *hlayout = new QHBoxLayout;
hlayout->setContentsMargins(44, 50, 73, 50);
hlayout->setContentsMargins(44, 0, 73, 0);
hlayout->setSpacing(50);
// Clickable SSID label
@ -235,16 +235,17 @@ void WifiUI::refresh() {
font-weight: %1;
text-align: left;
border: none;
padding: 0;
padding-top: 50px;
padding-bottom: 50px;
)").arg(weight));
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) {
QPushButton *connecting = new QPushButton("CONNECTING...");
connecting->setStyleSheet(R"(
font-size: 32px;
font-weight: 500;
font-weight: 600;
color: white;
border-radius: 0;
padding: 27px;
@ -293,5 +294,5 @@ void WifiUI::refresh() {
}
i++;
}
main_layout->addStretch(1);
main_layout->addStretch(2);
}

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

Loading…
Cancel
Save