Skip to content

Commit

Permalink
new wifi strength icon (#2601)
Browse files Browse the repository at this point in the history
* make wifi usable in apartments with lots of access points

* remove unused thing I added a few days ago...

* use a different image

* simpl. and correct scaling
  • Loading branch information
grekiki2 authored Nov 22, 2020
1 parent 0d62f05 commit b147d91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 5 additions & 3 deletions selfdrive/ui/qt/offroad/wifi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ void WifiUI::refresh() {
hlayout->addWidget(new QLabel(QString::fromUtf8(network.ssid)));

// strength indicator
unsigned int strength_scale = std::round(network.strength / 25.0) * 25;
QPixmap pix("../assets/offroad/indicator_wifi_" + QString::number(strength_scale) + ".png");
unsigned int strength_scale = network.strength / 17;
QPixmap pix("../assets/images/network_" + QString::number(strength_scale) + ".png");
QLabel *icon = new QLabel();
icon->setPixmap(pix.scaledToWidth(100, Qt::SmoothTransformation));
icon->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
Expand All @@ -99,7 +99,6 @@ void WifiUI::refresh() {
QWidget * w = new QWidget;
w->setLayout(hlayout);
vlayout->addWidget(w);

w->setStyleSheet(R"(
QLabel {
font-size: 40px;
Expand All @@ -114,6 +113,9 @@ void WifiUI::refresh() {
background-color: #114265;
}
)");
if(i > 10){
return;
}
}
}

Expand Down
3 changes: 0 additions & 3 deletions selfdrive/ui/qt/window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ MainWindow::MainWindow(QWidget *parent) : QWidget(parent) {
onboardingWindow = new OnboardingWindow(this);
main_layout->addWidget(onboardingWindow);

InputField *inputField = new InputField(this);
main_layout->addWidget(inputField);

main_layout->setMargin(0);
setLayout(main_layout);
QObject::connect(glWindow, SIGNAL(openSettings()), this, SLOT(openSettings()));
Expand Down

0 comments on commit b147d91

Please sign in to comment.