mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-29 18:42:07 +08:00
UI: fix alert flicker when controlsState not updated (#22921)
old-commit-hash: 2f90f04f8d1a64c22f4162e9425e80645bd28092
This commit is contained in:
@@ -42,10 +42,12 @@ OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent) {
|
||||
void OnroadWindow::updateState(const UIState &s) {
|
||||
QColor bgColor = bg_colors[s.status];
|
||||
Alert alert = Alert::get(*(s.sm), s.scene.started_frame);
|
||||
if (s.sm->updated("controlsState") || !alert.equal({})) {
|
||||
alerts->updateAlert(alert, bgColor);
|
||||
}
|
||||
if (alert.type == "controlsUnresponsive") {
|
||||
bgColor = bg_colors[STATUS_ALERT];
|
||||
}
|
||||
alerts->updateAlert(alert, bgColor);
|
||||
if (bg != bgColor) {
|
||||
// repaint border
|
||||
bg = bgColor;
|
||||
|
||||
Reference in New Issue
Block a user