new layout + 200px status images
This commit is contained in:
@@ -19,9 +19,9 @@ static const char *TAG = "audio_client";
|
||||
#define WS_BUFFER_SIZE 8192
|
||||
|
||||
/* Status image constants */
|
||||
#define STATUS_IMG_W 120
|
||||
#define STATUS_IMG_H 120
|
||||
#define STATUS_IMG_BYTES (STATUS_IMG_W * STATUS_IMG_H / 8) /* 1800 */
|
||||
#define STATUS_IMG_W 200
|
||||
#define STATUS_IMG_H 200
|
||||
#define STATUS_IMG_BYTES (STATUS_IMG_W * STATUS_IMG_H / 8) /* 5000 */
|
||||
|
||||
static esp_websocket_client_handle_t s_client = NULL;
|
||||
static CodecPort *s_codec = NULL;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user