Skip to content

Commit 413d148

Browse files
committed
- Added alignment adjustments for the voltage_left_label when BMS is connected and when no BMS is detected.
1 parent ac4c5f1 commit 413d148

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/sp140/lvgl/lvgl_updates.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,13 @@ void updateLvglMainScreen(
387387

388388
// Always use black text for better readability
389389
lv_obj_set_style_text_color(voltage_left_label, LVGL_BLACK, 0);
390+
// Restore default position when BMS is connected
391+
lv_obj_align(voltage_left_label, LV_ALIGN_TOP_LEFT, 3, 12);
390392
} else if (escConnected) {
391393
lv_obj_set_style_text_color(voltage_left_label, LVGL_BLACK, 0);
392394
lv_label_set_text(voltage_left_label, "NO\nBMS");
395+
// Move up by 10 pixels when showing NO BMS
396+
lv_obj_align(voltage_left_label, LV_ALIGN_TOP_LEFT, 3, 2);
393397
} else {
394398
lv_label_set_text(voltage_left_label, "");
395399
}

0 commit comments

Comments
 (0)