Dynamically colored alert widget. (#2717)

blue background on update
This commit is contained in:
grekiki
2020-12-10 23:39:15 +01:00
committed by GitHub
parent f96fb625d9
commit bffdfd5303

View File

@@ -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);
}