dashboard: maximize relay button height
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
static const char *DASHBOARD_VERSION = "0.1.26-relay-fill-card";
|
static const char *DASHBOARD_VERSION = "0.1.27-max-relay-buttons";
|
||||||
|
|
||||||
// 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 = 386;
|
static const int RELAY_STRIP_Y = 376;
|
||||||
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,8 +277,8 @@ static void layout_relay_buttons()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (i < relay_count) {
|
if (i < relay_count) {
|
||||||
lv_obj_set_size(relay_buttons[i], button_width, 132);
|
lv_obj_set_size(relay_buttons[i], button_width, 172);
|
||||||
lv_obj_align(relay_buttons[i], LV_ALIGN_TOP_LEFT, start_x + (i * (button_width + RELAY_BUTTON_GAP)), 18);
|
lv_obj_align(relay_buttons[i], LV_ALIGN_TOP_LEFT, start_x + (i * (button_width + RELAY_BUTTON_GAP)), 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -820,8 +820,8 @@ 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, 132);
|
lv_obj_set_size(relay_buttons[i], 140, 172);
|
||||||
lv_obj_align(relay_buttons[i], LV_ALIGN_TOP_LEFT, 14 + (i * 150), 18);
|
lv_obj_align(relay_buttons[i], LV_ALIGN_TOP_LEFT, 14 + (i * 150), 16);
|
||||||
lv_obj_add_event_cb(
|
lv_obj_add_event_cb(
|
||||||
relay_buttons[i],
|
relay_buttons[i],
|
||||||
relay_button_event_cb,
|
relay_button_event_cb,
|
||||||
@@ -831,7 +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_36, 0);
|
lv_obj_set_style_text_font(relay_button_labels[i], &lv_font_montserrat_40, 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);
|
||||||
|
|||||||
Reference in New Issue
Block a user