dashboard: clean up battery gauge spacing

This commit is contained in:
2026-06-10 02:01:44 -06:00
parent a1f9e782f9
commit ff4f84a219
2 changed files with 13 additions and 11 deletions
@@ -1,6 +1,6 @@
#pragma once #pragma once
static const char *DASHBOARD_VERSION = "0.1.15-battery-center-estimate"; static const char *DASHBOARD_VERSION = "0.1.16-battery-gauge-cleanup";
// Update these if your Cargo ESP AP credentials are different. // Update these if your Cargo ESP AP credentials are different.
static const char *CARGO_WIFI_SSID = "OverlandController"; static const char *CARGO_WIFI_SSID = "OverlandController";
@@ -200,15 +200,16 @@ static void update_battery_soc_gauge()
lv_arc_set_value(battery_soc_arc, soc); lv_arc_set_value(battery_soc_arc, soc);
lv_arc_set_angles(battery_soc_arc, 0, end_angle); lv_arc_set_angles(battery_soc_arc, 0, end_angle);
lv_obj_set_style_arc_color(
battery_soc_arc,
charging ? lv_color_hex(0x32D583) : lv_color_hex(0x84CAFF),
LV_PART_INDICATOR
);
lv_arc_set_value(battery_charge_pulse_arc, soc); lv_arc_set_value(battery_charge_pulse_arc, soc);
lv_arc_set_angles(battery_charge_pulse_arc, 0, end_angle); lv_arc_set_angles(battery_charge_pulse_arc, 0, end_angle);
if (charging) { lv_obj_add_flag(battery_charge_pulse_arc, LV_OBJ_FLAG_HIDDEN);
lv_obj_clear_flag(battery_charge_pulse_arc, LV_OBJ_FLAG_HIDDEN);
} else {
lv_obj_add_flag(battery_charge_pulse_arc, LV_OBJ_FLAG_HIDDEN);
}
lvgl_port_unlock(); lvgl_port_unlock();
@@ -742,7 +743,7 @@ static void create_overland_overview_screen()
lv_obj_set_style_arc_opa(battery_charge_pulse_arc, LV_OPA_TRANSP, LV_PART_MAIN); lv_obj_set_style_arc_opa(battery_charge_pulse_arc, LV_OPA_TRANSP, LV_PART_MAIN);
lv_obj_set_style_arc_color(battery_charge_pulse_arc, lv_color_hex(0x32D583), LV_PART_INDICATOR); lv_obj_set_style_arc_color(battery_charge_pulse_arc, lv_color_hex(0x32D583), LV_PART_INDICATOR);
lv_obj_set_style_arc_width(battery_charge_pulse_arc, 24, LV_PART_INDICATOR); lv_obj_set_style_arc_width(battery_charge_pulse_arc, 24, LV_PART_INDICATOR);
lv_obj_set_style_arc_opa(battery_charge_pulse_arc, LV_OPA_70, LV_PART_INDICATOR); lv_obj_set_style_arc_opa(battery_charge_pulse_arc, LV_OPA_TRANSP, LV_PART_INDICATOR);
lv_obj_add_flag(battery_charge_pulse_arc, LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(battery_charge_pulse_arc, LV_OBJ_FLAG_HIDDEN);
battery_soc_arc = lv_arc_create(battery_card); battery_soc_arc = lv_arc_create(battery_card);
@@ -762,10 +763,11 @@ static void create_overland_overview_screen()
battery_estimate_label = lv_label_create(battery_card); battery_estimate_label = lv_label_create(battery_card);
lv_label_set_text(battery_estimate_label, ""); lv_label_set_text(battery_estimate_label, "");
lv_obj_set_style_text_color(battery_estimate_label, lv_color_hex(0xB8C0C8), 0); lv_obj_set_style_text_color(battery_estimate_label, lv_color_hex(0xDDE3EA), 0);
lv_obj_set_width(battery_estimate_label, 320); lv_obj_set_style_text_font(battery_estimate_label, &lv_font_montserrat_26, 0);
lv_obj_set_width(battery_estimate_label, 340);
lv_obj_set_style_text_align(battery_estimate_label, LV_TEXT_ALIGN_CENTER, 0); lv_obj_set_style_text_align(battery_estimate_label, LV_TEXT_ALIGN_CENTER, 0);
lv_obj_align(battery_estimate_label, LV_ALIGN_TOP_MID, 0, 232); lv_obj_align(battery_estimate_label, LV_ALIGN_TOP_MID, 0, 246);
lv_obj_add_flag(battery_estimate_label, LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(battery_estimate_label, LV_OBJ_FLAG_HIDDEN);
battery_soc_label = lv_label_create(battery_card); battery_soc_label = lv_label_create(battery_card);
@@ -787,7 +789,7 @@ static void create_overland_overview_screen()
battery_current_label = lv_label_create(battery_card); battery_current_label = lv_label_create(battery_card);
lv_label_set_text(battery_current_label, ""); lv_label_set_text(battery_current_label, "");
lv_obj_set_style_text_font(battery_current_label, &lv_font_montserrat_30, 0); lv_obj_set_style_text_font(battery_current_label, &lv_font_montserrat_26, 0);
lv_obj_set_width(battery_current_label, 260); lv_obj_set_width(battery_current_label, 260);
lv_obj_set_style_text_align(battery_current_label, LV_TEXT_ALIGN_CENTER, 0); lv_obj_set_style_text_align(battery_current_label, LV_TEXT_ALIGN_CENTER, 0);
lv_obj_align(battery_current_label, LV_ALIGN_TOP_MID, 0, 166); lv_obj_align(battery_current_label, LV_ALIGN_TOP_MID, 0, 166);