dashboard: adjust main overview layout
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
static const char *DASHBOARD_VERSION = "0.1.6-boot-then-overview";
|
||||
static const char *DASHBOARD_VERSION = "0.1.7-main-layout";
|
||||
|
||||
// Update these if your Cargo ESP AP credentials are different.
|
||||
static const char *CARGO_WIFI_SSID = "OverlandController";
|
||||
|
||||
@@ -597,14 +597,15 @@ static void create_overland_overview_screen()
|
||||
lv_obj_clean(screen);
|
||||
lv_obj_set_style_bg_color(screen, lv_color_hex(0x101418), 0);
|
||||
|
||||
lv_obj_t *battery_card = create_card(screen, "Greta Battery", 300, 285, LV_ALIGN_TOP_LEFT, 32, 28);
|
||||
lv_obj_t *temp_card = create_card(screen, "Temperatures", 300, 285, LV_ALIGN_TOP_MID, 0, 28);
|
||||
lv_obj_t *relay_card = create_card(screen, "Outputs", 300, 285, LV_ALIGN_TOP_RIGHT, -32, 28);
|
||||
lv_obj_t *system_card = create_card(screen, "System", 620, 195, LV_ALIGN_BOTTOM_LEFT, 32, -42);
|
||||
lv_obj_t *battery_card = create_card(screen, "Greta Battery", 300, 350, LV_ALIGN_TOP_LEFT, 32, 24);
|
||||
lv_obj_t *temp_card = create_card(screen, "Temperatures", 300, 350, LV_ALIGN_TOP_MID, 0, 24);
|
||||
lv_obj_t *relay_card = create_card(screen, "Outputs", 300, 350, LV_ALIGN_TOP_RIGHT, -32, 24);
|
||||
lv_obj_t *system_card = create_card(screen, "Status", 620, 145, LV_ALIGN_BOTTOM_LEFT, 32, -38);
|
||||
lv_obj_t *nav_card = create_card(screen, "Pages", 300, 145, LV_ALIGN_BOTTOM_RIGHT, -32, -38);
|
||||
|
||||
battery_charge_pulse_arc = lv_arc_create(battery_card);
|
||||
lv_obj_set_size(battery_charge_pulse_arc, 190, 190);
|
||||
lv_obj_align(battery_charge_pulse_arc, LV_ALIGN_TOP_MID, 0, 29);
|
||||
lv_obj_align(battery_charge_pulse_arc, LV_ALIGN_TOP_MID, 0, 42);
|
||||
lv_arc_set_range(battery_charge_pulse_arc, 0, 100);
|
||||
lv_arc_set_value(battery_charge_pulse_arc, 0);
|
||||
lv_arc_set_rotation(battery_charge_pulse_arc, 135);
|
||||
@@ -620,7 +621,7 @@ static void create_overland_overview_screen()
|
||||
|
||||
battery_soc_arc = lv_arc_create(battery_card);
|
||||
lv_obj_set_size(battery_soc_arc, 166, 166);
|
||||
lv_obj_align(battery_soc_arc, LV_ALIGN_TOP_MID, 0, 41);
|
||||
lv_obj_align(battery_soc_arc, LV_ALIGN_TOP_MID, 0, 49);
|
||||
lv_arc_set_range(battery_soc_arc, 0, 100);
|
||||
lv_arc_set_value(battery_soc_arc, 0);
|
||||
lv_arc_set_rotation(battery_soc_arc, 135);
|
||||
@@ -639,20 +640,20 @@ static void create_overland_overview_screen()
|
||||
lv_obj_set_style_text_font(battery_soc_label, &lv_font_montserrat_30, 0);
|
||||
lv_obj_set_width(battery_soc_label, 190);
|
||||
lv_obj_set_style_text_align(battery_soc_label, LV_TEXT_ALIGN_CENTER, 0);
|
||||
lv_obj_align(battery_soc_label, LV_ALIGN_TOP_MID, 0, 82);
|
||||
lv_obj_align(battery_soc_label, LV_ALIGN_TOP_MID, 0, 90);
|
||||
|
||||
battery_voltage_label = lv_label_create(battery_card);
|
||||
lv_label_set_text(battery_voltage_label, "-- V");
|
||||
lv_obj_set_style_text_color(battery_voltage_label, lv_color_hex(0xB8C0C8), 0);
|
||||
lv_obj_set_width(battery_voltage_label, 190);
|
||||
lv_obj_set_style_text_align(battery_voltage_label, LV_TEXT_ALIGN_CENTER, 0);
|
||||
lv_obj_align(battery_voltage_label, LV_ALIGN_TOP_MID, 0, 128);
|
||||
lv_obj_align(battery_voltage_label, LV_ALIGN_TOP_MID, 0, 138);
|
||||
|
||||
battery_current_label = lv_label_create(battery_card);
|
||||
lv_label_set_text(battery_current_label, "");
|
||||
lv_obj_set_width(battery_current_label, 180);
|
||||
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, 154);
|
||||
lv_obj_align(battery_current_label, LV_ALIGN_TOP_MID, 0, 166);
|
||||
lv_obj_add_flag(battery_current_label, LV_OBJ_FLAG_HIDDEN);
|
||||
|
||||
inside_temp_label = lv_label_create(temp_card);
|
||||
@@ -694,12 +695,12 @@ static void create_overland_overview_screen()
|
||||
lv_label_set_long_mode(system_status_label, LV_LABEL_LONG_WRAP);
|
||||
lv_obj_align(system_status_label, LV_ALIGN_TOP_LEFT, 0, 35);
|
||||
|
||||
lv_obj_t *footer = lv_label_create(screen);
|
||||
lv_label_set_text(footer, "Fast: battery/temps/relays every 2s | Slow: system/config/network every 30s");
|
||||
lv_obj_set_style_text_color(footer, lv_color_hex(0x7D8996), 0);
|
||||
lv_obj_set_width(footer, 900);
|
||||
lv_obj_set_style_text_align(footer, LV_TEXT_ALIGN_CENTER, 0);
|
||||
lv_obj_align(footer, LV_ALIGN_BOTTOM_MID, 0, -14);
|
||||
lv_obj_t *nav_label = lv_label_create(nav_card);
|
||||
lv_label_set_text(nav_label, "Overview\nBattery\nTemps\nOutputs\nVehicle");
|
||||
lv_obj_set_style_text_color(nav_label, lv_color_hex(0xDDE3EA), 0);
|
||||
lv_obj_set_width(nav_label, 260);
|
||||
lv_label_set_long_mode(nav_label, LV_LABEL_LONG_WRAP);
|
||||
lv_obj_align(nav_label, LV_ALIGN_TOP_LEFT, 0, 35);
|
||||
}
|
||||
|
||||
void setup()
|
||||
|
||||
Reference in New Issue
Block a user