Dynamically colored alert widget. (#2717)

blue background on update

old-commit-hash: bffdfd5303
commatwo_master
grekiki 5 years ago committed by GitHub
parent 3bc7286704
commit 55bd34e8a5
  1. 10
      selfdrive/ui/qt/home.cc

@ -99,7 +99,9 @@ void OffroadHome::refresh() {
}
alert_notification->setVisible(true);
alert_notification->setStyleSheet(QString(R"(
// Red background for alerts, blue for update available
QString style = QString(R"(
padding: 15px;
padding-left: 30px;
padding-right: 30px;
@ -108,7 +110,11 @@ void OffroadHome::refresh() {
font-size: 40px;
font-weight: bold;
background-color: red;
)"));
)");
if (alerts_widget->updateAvailable){
style.replace("red", "blue");
}
alert_notification->setStyleSheet(style);
}

Loading…
Cancel
Save