Hide battery indicator on splash screen unconditionally

This commit is contained in:
Hermann Björgvin Haraldsson
2026-05-11 01:06:37 +00:00
parent b61936b42c
commit 12172d12bf
+3 -7
View File
@@ -463,14 +463,11 @@ void ui_tick_anim(void) {
}
static screen_t prev_non_splash_screen = SCREEN_USAGE;
static int last_battery_idx = 0;
// Hide the battery indicator on the splash screen when it's in the low state —
// the small icon is visually noisy over the pixel-art creature animations.
// Hide the battery indicator on the splash screen — the icon is visually
// noisy over the pixel-art creature animations.
static void apply_battery_visibility(void) {
if (!battery_img) return;
bool hide = (current_screen == SCREEN_SPLASH && last_battery_idx == 1);
if (hide) lv_obj_add_flag(battery_img, LV_OBJ_FLAG_HIDDEN);
if (current_screen == SCREEN_SPLASH) lv_obj_add_flag(battery_img, LV_OBJ_FLAG_HIDDEN);
else lv_obj_clear_flag(battery_img, LV_OBJ_FLAG_HIDDEN);
}
@@ -574,6 +571,5 @@ void ui_update_battery(int percent, bool charging) {
idx = 3; // full
}
lv_image_set_src(battery_img, &battery_dscs[idx]);
last_battery_idx = idx;
apply_battery_visibility();
}