Skip to content

Commit 8704e99

Browse files
committed
Adjust critical alert counter positioning logic
Critical alert counter circle is now positioned differently based on the presence of warning alerts: aligned with alert text if no warnings, or to the right of the warning circle if warnings exist. This improves UI clarity and avoids overlapping visual elements.
1 parent 5bcd8b0 commit 8704e99

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/sp140/lvgl/lvgl_alerts.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void updateAlertCounterDisplay(const AlertCounts& counts) {
115115
lv_obj_add_flag(warning_counter_circle, LV_OBJ_FLAG_HIDDEN);
116116
}
117117

118-
// Critical
118+
// Critical
119119
if (counts.criticalCount > 0) {
120120
char buf[4];
121121
if (counts.criticalCount > 9) {
@@ -125,6 +125,15 @@ void updateAlertCounterDisplay(const AlertCounts& counts) {
125125
}
126126
lv_label_set_text(critical_counter_label, buf);
127127
lv_obj_clear_flag(critical_counter_circle, LV_OBJ_FLAG_HIDDEN);
128+
129+
// Simple positioning: align with alert text if no warnings, otherwise right of warning circle
130+
if (counts.warningCount == 0) {
131+
// No warnings: position to align with alert text (avoid red border)
132+
lv_obj_align(critical_counter_circle, LV_ALIGN_TOP_LEFT, 10, 75);
133+
} else {
134+
// With warnings: position to right of warning circle
135+
lv_obj_align(critical_counter_circle, LV_ALIGN_TOP_LEFT, 35, 75);
136+
}
128137
} else {
129138
lv_obj_add_flag(critical_counter_circle, LV_OBJ_FLAG_HIDDEN);
130139
}

0 commit comments

Comments
 (0)