nav: eta match alert colors

old-commit-hash: ff94882fa6
commatwo_master
Willem Melching 4 years ago
parent 9643e0fcdd
commit 8fd0aafdbc
  1. 18
      selfdrive/ui/qt/maps/map.cc

@ -625,12 +625,10 @@ MapETA::MapETA(QWidget * parent) : QWidget(parent){
} }
{ {
QVBoxLayout *layout = new QVBoxLayout; QVBoxLayout *layout = new QVBoxLayout;
time = new QLabel("22"); time = new QLabel;
time->setStyleSheet(R"(color: green; )");
time->setAlignment(Qt::AlignCenter); time->setAlignment(Qt::AlignCenter);
time_unit = new QLabel("min"); time_unit = new QLabel;
time_unit->setStyleSheet(R"(color: green; )");
time_unit->setAlignment(Qt::AlignCenter); time_unit->setAlignment(Qt::AlignCenter);
layout->addStretch(); layout->addStretch();
@ -687,14 +685,14 @@ void MapETA::updateETA(float s, float s_typical, float d) {
} }
if (s / s_typical > 1.5) { if (s / s_typical > 1.5) {
time_unit->setStyleSheet(R"(color: red; )"); time_unit->setStyleSheet(R"(color: #c92231; )");
time->setStyleSheet(R"(color: red; )"); time->setStyleSheet(R"(color: #c92231; )");
} else if (s / s_typical > 1.2) { } else if (s / s_typical > 1.2) {
time_unit->setStyleSheet(R"(color: orange; )"); time_unit->setStyleSheet(R"(color: #da6f25; )");
time->setStyleSheet(R"(color: orange; )"); time->setStyleSheet(R"(color: #da6f25; )");
} else { } else {
time_unit->setStyleSheet(R"(color: green; )"); time_unit->setStyleSheet(R"(color: #178644; )");
time->setStyleSheet(R"(color: green; )"); time->setStyleSheet(R"(color: #178644; )");
} }
// Distance // Distance

Loading…
Cancel
Save