new layout + 200px status images

This commit is contained in:
Mikkeli Matlock
2026-02-16 14:52:20 +09:00
parent 7165f56464
commit 4e2c714e1f
4 changed files with 17 additions and 17 deletions

View File

@@ -227,12 +227,12 @@ static void create_time_bar(lv_obj_t *parent)
static void create_main_section(lv_obj_t *parent)
{
/* === Left column: Services === */
/* === Left column: Services + Pi Vitals === */
create_label(parent, 4, MAIN_Y + 2, &InziuIosevka_Slab_CC_12px, "SERVICES");
tbl_services = lv_table_create(parent);
lv_obj_set_pos(tbl_services, 4, MAIN_Y + 16);
lv_obj_set_size(tbl_services, 190, 180);
lv_obj_set_size(tbl_services, 190, 68);
lv_table_set_col_cnt(tbl_services, 2);
lv_table_set_col_width(tbl_services, 0, 110);
lv_table_set_col_width(tbl_services, 1, 65);
@@ -251,19 +251,19 @@ static void create_main_section(lv_obj_t *parent)
/* Auto-scroll timer: 3 second period */
s_scroll_timer = lv_timer_create(scroll_timer_cb, 3000, NULL);
/* === Right column: Pi Vitals + Local Sensors === */
int rx = RIGHT_COL_X;
/* === Left column: Pi Vitals (below services) === */
int rx = 0;
int row_h = 18; /* vertical spacing per stat row */
int lbl_w = 36; /* width reserved for "CPU " etc */
int bar_w = 82;
int bar_h = 12;
int val_x = rx + 4 + lbl_w + bar_w + 4; /* value label after bar */
int temp_x = rx + 156; /* TEMP column, right of value labels */
int temp_x = rx + 160; /* TEMP column, right of value labels */
/* Pi Vitals header */
create_label(parent, rx + 4, MAIN_Y + 2, &InziuIosevka_Slab_CC_12px, "PI VITALS");
/* Pi Vitals header — Y=162 */
create_label(parent, rx + 4, 162, &InziuIosevka_Slab_CC_12px, "PI VITALS");
int ry = MAIN_Y + 18;
int ry = 176;
/* CPU [========] 12% TEMP */
create_label(parent, rx + 4, ry, &InziuIosevka_Slab_CC_12px, "CPU");
@@ -288,10 +288,10 @@ static void create_main_section(lv_obj_t *parent)
ry += row_h;
lbl_uptime = create_label(parent, rx + 4, ry, &InziuIosevka_Slab_CC_12px, "Uptime: --h");
/* === Status image (120x120, bottom-right above bot bar) === */
/* === Right column: Status image (200x200) === */
img_status = lv_img_create(parent);
lv_obj_set_pos(img_status, 280, 156);
lv_obj_set_size(img_status, 120, 120);
lv_obj_set_pos(img_status, 200, MAIN_Y + 2);
lv_obj_set_size(img_status, 200, 200);
lv_obj_set_style_bg_color(img_status, lv_color_white(), 0);
lv_obj_set_style_bg_opa(img_status, LV_OPA_COVER, 0);
}