dashboard: enlarge relay control strip

This commit is contained in:
2026-06-10 02:29:24 -06:00
parent b6816e463c
commit 65039f9ae3
2 changed files with 5 additions and 4 deletions
@@ -1,6 +1,6 @@
#pragma once #pragma once
static const char *DASHBOARD_VERSION = "0.1.24-card-padding-trim"; static const char *DASHBOARD_VERSION = "0.1.25-taller-relay-strip";
// 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";
@@ -34,7 +34,7 @@ static bool relay_states[6] = {false};
static int relay_count = 0; static int relay_count = 0;
static const int RELAY_STRIP_X = 32; static const int RELAY_STRIP_X = 32;
static const int RELAY_STRIP_Y = 408; static const int RELAY_STRIP_Y = 390;
static const int RELAY_STRIP_W = 960; static const int RELAY_STRIP_W = 960;
static const int RELAY_BUTTON_GAP = 10; static const int RELAY_BUTTON_GAP = 10;
@@ -277,7 +277,7 @@ static void layout_relay_buttons()
} }
if (i < relay_count) { if (i < relay_count) {
lv_obj_set_size(relay_buttons[i], button_width, 62); lv_obj_set_size(relay_buttons[i], button_width, 102);
lv_obj_align(relay_buttons[i], LV_ALIGN_TOP_LEFT, start_x + (i * (button_width + RELAY_BUTTON_GAP)), 34); lv_obj_align(relay_buttons[i], LV_ALIGN_TOP_LEFT, start_x + (i * (button_width + RELAY_BUTTON_GAP)), 34);
} }
} }
@@ -820,7 +820,7 @@ static void create_overland_overview_screen()
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
relay_buttons[i] = lv_btn_create(relay_card); relay_buttons[i] = lv_btn_create(relay_card);
lv_obj_set_size(relay_buttons[i], 140, 62); lv_obj_set_size(relay_buttons[i], 140, 102);
lv_obj_align(relay_buttons[i], LV_ALIGN_TOP_LEFT, 14 + (i * 150), 34); lv_obj_align(relay_buttons[i], LV_ALIGN_TOP_LEFT, 14 + (i * 150), 34);
lv_obj_add_event_cb( lv_obj_add_event_cb(
relay_buttons[i], relay_buttons[i],
@@ -831,6 +831,7 @@ static void create_overland_overview_screen()
relay_button_labels[i] = lv_label_create(relay_buttons[i]); relay_button_labels[i] = lv_label_create(relay_buttons[i]);
lv_label_set_text(relay_button_labels[i], "Output\n--"); lv_label_set_text(relay_button_labels[i], "Output\n--");
lv_obj_set_style_text_font(relay_button_labels[i], &lv_font_montserrat_30, 0);
lv_obj_set_style_text_align(relay_button_labels[i], LV_TEXT_ALIGN_CENTER, 0); lv_obj_set_style_text_align(relay_button_labels[i], LV_TEXT_ALIGN_CENTER, 0);
lv_obj_center(relay_button_labels[i]); lv_obj_center(relay_button_labels[i]);
lv_obj_add_flag(relay_buttons[i], LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(relay_buttons[i], LV_OBJ_FLAG_HIDDEN);