|
@@ -5,12 +5,13 @@
|
|
|
*
|
|
*
|
|
|
* @note 构建工业设备主页:
|
|
* @note 构建工业设备主页:
|
|
|
* - 顶部状态栏: 设备名称 + 就绪状态指示灯 (就绪=绿, 未就绪=红)
|
|
* - 顶部状态栏: 设备名称 + 就绪状态指示灯 (就绪=绿, 未就绪=红)
|
|
|
- * - 左侧菜单栏: 实时温度 / 设备状态 / 温度设置
|
|
|
|
|
|
|
+ * - 左侧菜单栏: 实时温度 / 设备状态 / 温度设置 (含选中高亮)
|
|
|
* - 右侧内容区: 随菜单点击切换对应页面
|
|
* - 右侧内容区: 随菜单点击切换对应页面
|
|
|
******************************************************************************
|
|
******************************************************************************
|
|
|
*/
|
|
*/
|
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
|
#include "Ui.h"
|
|
#include "Ui.h"
|
|
|
|
|
+#include "Ui_theme.h"
|
|
|
#include "Ui_temperature.h"
|
|
#include "Ui_temperature.h"
|
|
|
#include "Ui_status.h"
|
|
#include "Ui_status.h"
|
|
|
#include "Ui_temp_setting.h"
|
|
#include "Ui_temp_setting.h"
|
|
@@ -27,6 +28,12 @@ typedef enum
|
|
|
UI_READY_NOT = 1 /* 未就绪 (红) */
|
|
UI_READY_NOT = 1 /* 未就绪 (红) */
|
|
|
} ui_ready_state_t;
|
|
} ui_ready_state_t;
|
|
|
|
|
|
|
|
|
|
+/* 就绪徽章配色 (底色微染 + 描边) */
|
|
|
|
|
+#define UI_BADGE_OK_BG lv_color_hex(0x0E2417)
|
|
|
|
|
+#define UI_BADGE_OK_BORDER lv_color_hex(0x2C6E44)
|
|
|
|
|
+#define UI_BADGE_ERR_BG lv_color_hex(0x24110F)
|
|
|
|
|
+#define UI_BADGE_ERR_BORDER lv_color_hex(0x6E2C2C)
|
|
|
|
|
+
|
|
|
/* 全局句柄 */
|
|
/* 全局句柄 */
|
|
|
static lv_obj_t * s_status_dot = NULL; /* 状态指示灯 (圆点) */
|
|
static lv_obj_t * s_status_dot = NULL; /* 状态指示灯 (圆点) */
|
|
|
static lv_obj_t * s_status_label = NULL; /* 状态文字 ("Ready"/"Not Ready") */
|
|
static lv_obj_t * s_status_label = NULL; /* 状态文字 ("Ready"/"Not Ready") */
|
|
@@ -50,6 +57,10 @@ static const char * s_menu_text[UI_MENU_MAX] =
|
|
|
"Temp Setting",
|
|
"Temp Setting",
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+static lv_obj_t * s_menu_btns[UI_MENU_MAX] = { NULL }; /* 菜单按钮句柄 */
|
|
|
|
|
+static lv_obj_t * s_menu_labels[UI_MENU_MAX] = { NULL }; /* 菜单按钮文字句柄 */
|
|
|
|
|
+static uint8_t s_menu_active = UI_MENU_TEMPERATURE; /* 当前选中菜单 */
|
|
|
|
|
+
|
|
|
/*----------------------------- 静态函数 ------------------------------*/
|
|
/*----------------------------- 静态函数 ------------------------------*/
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -70,37 +81,39 @@ static void ui_build_status_bar(lv_obj_t * scr)
|
|
|
lv_obj_t * bar = lv_obj_create(scr);
|
|
lv_obj_t * bar = lv_obj_create(scr);
|
|
|
lv_obj_set_size(bar, lv_pct(100), UI_STATUS_BAR_H);
|
|
lv_obj_set_size(bar, lv_pct(100), UI_STATUS_BAR_H);
|
|
|
lv_obj_set_pos(bar, 0, 0);
|
|
lv_obj_set_pos(bar, 0, 0);
|
|
|
|
|
+ Ui_theme_clear_visuals(bar);
|
|
|
lv_obj_set_style_radius(bar, 0, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(bar, 0, LV_STATE_DEFAULT);
|
|
|
- lv_obj_set_style_border_width(bar, 0, LV_STATE_DEFAULT);
|
|
|
|
|
- lv_obj_set_style_bg_color(bar, lv_color_hex(0x202830), LV_STATE_DEFAULT);
|
|
|
|
|
- lv_obj_set_style_pad_all(bar, 0, LV_STATE_DEFAULT);
|
|
|
|
|
- ui_fix_scroll(bar);
|
|
|
|
|
|
|
+ lv_obj_set_style_bg_color(bar, UI_CLR_STATUS_BAR, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_bg_opa(bar, LV_OPA_COVER, LV_STATE_DEFAULT);
|
|
|
|
|
+ /* 底部强调色分隔线 */
|
|
|
|
|
+ lv_obj_set_style_border_width(bar, 2, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_border_side(bar, LV_BORDER_SIDE_BOTTOM, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_border_color(bar, UI_CLR_ACCENT, LV_STATE_DEFAULT);
|
|
|
|
|
|
|
|
/* 左侧设备名称 */
|
|
/* 左侧设备名称 */
|
|
|
lv_obj_t * name = lv_label_create(bar);
|
|
lv_obj_t * name = lv_label_create(bar);
|
|
|
lv_label_set_text(name, "Temperature Control System");
|
|
lv_label_set_text(name, "Temperature Control System");
|
|
|
lv_obj_set_style_text_font(name, &lv_font_montserrat_16, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(name, &lv_font_montserrat_16, LV_STATE_DEFAULT);
|
|
|
- lv_obj_set_style_text_color(name, lv_color_hex(0xFFFFFF), LV_STATE_DEFAULT);
|
|
|
|
|
|
|
+ lv_obj_set_style_text_color(name, UI_CLR_TEXT, LV_STATE_DEFAULT);
|
|
|
lv_obj_align(name, LV_ALIGN_LEFT_MID, 16, 0);
|
|
lv_obj_align(name, LV_ALIGN_LEFT_MID, 16, 0);
|
|
|
|
|
|
|
|
- /* 右侧就绪徽章 (圆角底 + 圆点 + 状态文字, 清除默认主题视觉成纯色) */
|
|
|
|
|
|
|
+ /* 右侧就绪徽章 (圆角底 + 圆点 + 状态文字) */
|
|
|
s_status_badge = lv_obj_create(bar);
|
|
s_status_badge = lv_obj_create(bar);
|
|
|
lv_obj_set_size(s_status_badge, 150, 30);
|
|
lv_obj_set_size(s_status_badge, 150, 30);
|
|
|
lv_obj_align(s_status_badge, LV_ALIGN_RIGHT_MID, -16, 0);
|
|
lv_obj_align(s_status_badge, LV_ALIGN_RIGHT_MID, -16, 0);
|
|
|
lv_obj_set_style_radius(s_status_badge, LV_RADIUS_CIRCLE, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(s_status_badge, LV_RADIUS_CIRCLE, LV_STATE_DEFAULT);
|
|
|
lv_obj_set_style_bg_opa(s_status_badge, LV_OPA_COVER, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_opa(s_status_badge, LV_OPA_COVER, LV_STATE_DEFAULT);
|
|
|
- lv_obj_set_style_border_opa(s_status_badge, LV_OPA_TRANSP, LV_STATE_DEFAULT);
|
|
|
|
|
|
|
+ lv_obj_set_style_border_width(s_status_badge, 1, LV_STATE_DEFAULT);
|
|
|
lv_obj_set_style_shadow_width(s_status_badge, 0, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_width(s_status_badge, 0, LV_STATE_DEFAULT);
|
|
|
lv_obj_set_style_shadow_opa(s_status_badge, LV_OPA_TRANSP, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_opa(s_status_badge, LV_OPA_TRANSP, LV_STATE_DEFAULT);
|
|
|
lv_obj_set_style_outline_width(s_status_badge, 0, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_outline_width(s_status_badge, 0, LV_STATE_DEFAULT);
|
|
|
lv_obj_set_style_pad_all(s_status_badge, 0, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_all(s_status_badge, 0, LV_STATE_DEFAULT);
|
|
|
- lv_obj_clear_flag(s_status_badge, LV_OBJ_FLAG_SCROLLABLE);
|
|
|
|
|
- lv_obj_set_scrollbar_mode(s_status_badge, LV_SCROLLBAR_MODE_OFF);
|
|
|
|
|
|
|
+ ui_fix_scroll(s_status_badge);
|
|
|
|
|
|
|
|
/* 徽章内圆点 (就绪指示灯, 纯色实心圆) */
|
|
/* 徽章内圆点 (就绪指示灯, 纯色实心圆) */
|
|
|
s_status_dot = lv_obj_create(s_status_badge);
|
|
s_status_dot = lv_obj_create(s_status_badge);
|
|
|
lv_obj_set_size(s_status_dot, 14, 14);
|
|
lv_obj_set_size(s_status_dot, 14, 14);
|
|
|
- lv_obj_align(s_status_dot, LV_ALIGN_LEFT_MID, 10, 0);
|
|
|
|
|
|
|
+ lv_obj_align(s_status_dot, LV_ALIGN_LEFT_MID, 12, 0);
|
|
|
lv_obj_set_style_radius(s_status_dot, LV_RADIUS_CIRCLE, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(s_status_dot, LV_RADIUS_CIRCLE, LV_STATE_DEFAULT);
|
|
|
lv_obj_set_style_bg_opa(s_status_dot, LV_OPA_COVER, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_opa(s_status_dot, LV_OPA_COVER, LV_STATE_DEFAULT);
|
|
|
lv_obj_set_style_border_opa(s_status_dot, LV_OPA_TRANSP, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_border_opa(s_status_dot, LV_OPA_TRANSP, LV_STATE_DEFAULT);
|
|
@@ -108,14 +121,12 @@ static void ui_build_status_bar(lv_obj_t * scr)
|
|
|
lv_obj_set_style_shadow_opa(s_status_dot, LV_OPA_TRANSP, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_shadow_opa(s_status_dot, LV_OPA_TRANSP, LV_STATE_DEFAULT);
|
|
|
lv_obj_set_style_outline_width(s_status_dot, 0, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_outline_width(s_status_dot, 0, LV_STATE_DEFAULT);
|
|
|
lv_obj_set_style_pad_all(s_status_dot, 0, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_all(s_status_dot, 0, LV_STATE_DEFAULT);
|
|
|
- lv_obj_clear_flag(s_status_dot, LV_OBJ_FLAG_SCROLLABLE);
|
|
|
|
|
- lv_obj_set_scrollbar_mode(s_status_dot, LV_SCROLLBAR_MODE_OFF);
|
|
|
|
|
|
|
+ ui_fix_scroll(s_status_dot);
|
|
|
|
|
|
|
|
/* 徽章内状态文字 */
|
|
/* 徽章内状态文字 */
|
|
|
s_status_label = lv_label_create(s_status_badge);
|
|
s_status_label = lv_label_create(s_status_badge);
|
|
|
lv_label_set_text(s_status_label, "Not Ready");
|
|
lv_label_set_text(s_status_label, "Not Ready");
|
|
|
lv_obj_set_style_text_font(s_status_label, &lv_font_montserrat_16, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(s_status_label, &lv_font_montserrat_16, LV_STATE_DEFAULT);
|
|
|
- lv_obj_set_style_text_color(s_status_label, lv_color_hex(0xFFFFFF), LV_STATE_DEFAULT);
|
|
|
|
|
lv_obj_align(s_status_label, LV_ALIGN_RIGHT_MID, -12, 0);
|
|
lv_obj_align(s_status_label, LV_ALIGN_RIGHT_MID, -12, 0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -131,20 +142,43 @@ static void ui_refresh_ready(void)
|
|
|
|
|
|
|
|
if (s_ready == UI_READY_READY)
|
|
if (s_ready == UI_READY_READY)
|
|
|
{
|
|
{
|
|
|
- lv_obj_set_style_bg_color(s_status_badge, lv_color_hex(0x00A800), LV_STATE_DEFAULT);
|
|
|
|
|
- lv_obj_set_style_bg_color(s_status_dot, lv_color_hex(0x00FF00), LV_STATE_DEFAULT);
|
|
|
|
|
- lv_obj_set_style_text_color(s_status_label, lv_color_hex(0x003000), LV_STATE_DEFAULT);
|
|
|
|
|
|
|
+ lv_obj_set_style_bg_color(s_status_badge, UI_BADGE_OK_BG, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_border_color(s_status_badge, UI_BADGE_OK_BORDER, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_bg_color(s_status_dot, UI_CLR_OK, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_text_color(s_status_label, UI_CLR_OK, LV_STATE_DEFAULT);
|
|
|
lv_label_set_text(s_status_label, "Ready");
|
|
lv_label_set_text(s_status_label, "Ready");
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- lv_obj_set_style_bg_color(s_status_badge, lv_color_hex(0x8E0000), LV_STATE_DEFAULT);
|
|
|
|
|
- lv_obj_set_style_bg_color(s_status_dot, lv_color_hex(0xFF3030), LV_STATE_DEFAULT);
|
|
|
|
|
- lv_obj_set_style_text_color(s_status_label, lv_color_hex(0xFFFFFF), LV_STATE_DEFAULT);
|
|
|
|
|
|
|
+ lv_obj_set_style_bg_color(s_status_badge, UI_BADGE_ERR_BG, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_border_color(s_status_badge, UI_BADGE_ERR_BORDER, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_bg_color(s_status_dot, UI_CLR_ERR, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_text_color(s_status_label, UI_CLR_ERR, LV_STATE_DEFAULT);
|
|
|
lv_label_set_text(s_status_label, "Not Ready");
|
|
lv_label_set_text(s_status_label, "Not Ready");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * @brief 刷新左侧菜单的选中高亮 (选中项: 强调色底 + 深色文字)
|
|
|
|
|
+ */
|
|
|
|
|
+static void ui_menu_refresh_active(void)
|
|
|
|
|
+{
|
|
|
|
|
+ uint32_t i;
|
|
|
|
|
+ for (i = 0; i < UI_MENU_MAX; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (i == s_menu_active)
|
|
|
|
|
+ {
|
|
|
|
|
+ lv_obj_set_style_bg_color(s_menu_btns[i], UI_CLR_ACCENT, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_text_color(s_menu_labels[i], UI_CLR_ACCENT_DARK, LV_STATE_DEFAULT);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ lv_obj_set_style_bg_color(s_menu_btns[i], UI_CLR_PANEL_HI, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_text_color(s_menu_labels[i], UI_CLR_TEXT_DIM, LV_STATE_DEFAULT);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief UI 菜单按钮点击事件回调: 切换右侧内容区页面
|
|
* @brief UI 菜单按钮点击事件回调: 切换右侧内容区页面
|
|
|
*/
|
|
*/
|
|
@@ -152,6 +186,10 @@ static void ui_menu_click_cb(lv_event_t * e)
|
|
|
{
|
|
{
|
|
|
uint32_t menu_id = (uint32_t)(uintptr_t)lv_event_get_user_data(e);
|
|
uint32_t menu_id = (uint32_t)(uintptr_t)lv_event_get_user_data(e);
|
|
|
|
|
|
|
|
|
|
+ /* 更新选中高亮 */
|
|
|
|
|
+ s_menu_active = (uint8_t)menu_id;
|
|
|
|
|
+ ui_menu_refresh_active();
|
|
|
|
|
+
|
|
|
/* 清空内容区, 重新构建对应页面 */
|
|
/* 清空内容区, 重新构建对应页面 */
|
|
|
lv_obj_clean(s_content);
|
|
lv_obj_clean(s_content);
|
|
|
|
|
|
|
@@ -182,15 +220,14 @@ static void ui_build_menu(lv_obj_t * scr)
|
|
|
lv_obj_t * menu = lv_obj_create(scr);
|
|
lv_obj_t * menu = lv_obj_create(scr);
|
|
|
lv_obj_set_size(menu, UI_MENU_W, menu_h);
|
|
lv_obj_set_size(menu, UI_MENU_W, menu_h);
|
|
|
lv_obj_set_pos(menu, 0, UI_STATUS_BAR_H);
|
|
lv_obj_set_pos(menu, 0, UI_STATUS_BAR_H);
|
|
|
|
|
+ Ui_theme_clear_visuals(menu);
|
|
|
lv_obj_set_style_radius(menu, 0, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(menu, 0, LV_STATE_DEFAULT);
|
|
|
- lv_obj_set_style_border_width(menu, 0, LV_STATE_DEFAULT);
|
|
|
|
|
- lv_obj_set_style_bg_color(menu, lv_color_hex(0x283038), LV_STATE_DEFAULT);
|
|
|
|
|
|
|
+ lv_obj_set_style_bg_color(menu, UI_CLR_MENU, LV_STATE_DEFAULT);
|
|
|
lv_obj_set_style_pad_all(menu, 8, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_pad_all(menu, 8, LV_STATE_DEFAULT);
|
|
|
- ui_fix_scroll(menu);
|
|
|
|
|
|
|
|
|
|
/* 三个按钮均分左侧可用高度 */
|
|
/* 三个按钮均分左侧可用高度 */
|
|
|
- lv_coord_t btn_w = UI_MENU_W - 16; /* 内容区宽度 */
|
|
|
|
|
- lv_coord_t col_h = menu_h - 16; /* 内容区高度 (扣除上下 pad) */
|
|
|
|
|
|
|
+ lv_coord_t btn_w = UI_MENU_W - 16; /* 按钮宽度 (菜单宽 - 左右 pad) */
|
|
|
|
|
+ lv_coord_t col_h = menu_h - 16; /* 按钮可用总高度 (菜单高 - 上下 pad) */
|
|
|
lv_coord_t gap = 6;
|
|
lv_coord_t gap = 6;
|
|
|
lv_coord_t btn_h = (col_h - (UI_MENU_MAX - 1) * gap) / UI_MENU_MAX;
|
|
lv_coord_t btn_h = (col_h - (UI_MENU_MAX - 1) * gap) / UI_MENU_MAX;
|
|
|
if (btn_h < 24)
|
|
if (btn_h < 24)
|
|
@@ -207,11 +244,29 @@ static void ui_build_menu(lv_obj_t * scr)
|
|
|
lv_obj_align(btn, LV_ALIGN_TOP_MID, 0, 0 + i * (btn_h + gap));
|
|
lv_obj_align(btn, LV_ALIGN_TOP_MID, 0, 0 + i * (btn_h + gap));
|
|
|
lv_obj_add_event_cb(btn, ui_menu_click_cb, LV_EVENT_CLICKED, (void *)(uintptr_t)i);
|
|
lv_obj_add_event_cb(btn, ui_menu_click_cb, LV_EVENT_CLICKED, (void *)(uintptr_t)i);
|
|
|
|
|
|
|
|
|
|
+ /* 基础样式: 圆角 + 无边框/阴影, 按下强调色 */
|
|
|
|
|
+ lv_obj_set_style_radius(btn, 8, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_bg_opa(btn, LV_OPA_COVER, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_border_width(btn, 0, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_shadow_width(btn, 0, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_shadow_opa(btn, LV_OPA_TRANSP, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_outline_width(btn, 0, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_pad_all(btn, 0, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_bg_color(btn, UI_CLR_ACCENT, LV_STATE_PRESSED);
|
|
|
|
|
+ ui_fix_scroll(btn);
|
|
|
|
|
+
|
|
|
lv_obj_t * lbl = lv_label_create(btn);
|
|
lv_obj_t * lbl = lv_label_create(btn);
|
|
|
lv_label_set_text(lbl, s_menu_text[i]);
|
|
lv_label_set_text(lbl, s_menu_text[i]);
|
|
|
lv_obj_set_style_text_font(lbl, &lv_font_montserrat_16, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_text_font(lbl, &lv_font_montserrat_16, LV_STATE_DEFAULT);
|
|
|
|
|
+ lv_obj_set_style_text_color(lbl, UI_CLR_ACCENT_DARK, LV_STATE_PRESSED);
|
|
|
lv_obj_center(lbl);
|
|
lv_obj_center(lbl);
|
|
|
|
|
+
|
|
|
|
|
+ s_menu_btns[i] = btn;
|
|
|
|
|
+ s_menu_labels[i] = lbl;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /* 初始选中态 */
|
|
|
|
|
+ ui_menu_refresh_active();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -222,11 +277,9 @@ static void ui_build_content(lv_obj_t * scr)
|
|
|
s_content = lv_obj_create(scr);
|
|
s_content = lv_obj_create(scr);
|
|
|
lv_obj_set_size(s_content, lv_pct(100), lv_pct(100));
|
|
lv_obj_set_size(s_content, lv_pct(100), lv_pct(100));
|
|
|
lv_obj_set_pos(s_content, UI_CONTENT_X, UI_STATUS_BAR_H + 4);
|
|
lv_obj_set_pos(s_content, UI_CONTENT_X, UI_STATUS_BAR_H + 4);
|
|
|
|
|
+ Ui_theme_clear_visuals(s_content);
|
|
|
lv_obj_set_style_radius(s_content, 0, LV_STATE_DEFAULT);
|
|
lv_obj_set_style_radius(s_content, 0, LV_STATE_DEFAULT);
|
|
|
- lv_obj_set_style_border_width(s_content, 0, LV_STATE_DEFAULT);
|
|
|
|
|
- lv_obj_set_style_bg_color(s_content, lv_color_hex(0x10151A), LV_STATE_DEFAULT);
|
|
|
|
|
- lv_obj_set_style_pad_all(s_content, 0, LV_STATE_DEFAULT);
|
|
|
|
|
- ui_fix_scroll(s_content);
|
|
|
|
|
|
|
+ lv_obj_set_style_bg_color(s_content, UI_CLR_BG, LV_STATE_DEFAULT);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*----------------------------- 全局函数 ------------------------------*/
|
|
/*----------------------------- 全局函数 ------------------------------*/
|
|
@@ -239,7 +292,7 @@ void Ui_init(void)
|
|
|
lv_obj_t * scr = lv_scr_act();
|
|
lv_obj_t * scr = lv_scr_act();
|
|
|
|
|
|
|
|
/* 默认深色背景 */
|
|
/* 默认深色背景 */
|
|
|
- lv_obj_set_style_bg_color(scr, lv_color_hex(0x10151A), LV_STATE_DEFAULT);
|
|
|
|
|
|
|
+ lv_obj_set_style_bg_color(scr, UI_CLR_BG, LV_STATE_DEFAULT);
|
|
|
|
|
|
|
|
/* 固定整屏, 防止左滑拖动页面 */
|
|
/* 固定整屏, 防止左滑拖动页面 */
|
|
|
ui_fix_scroll(scr);
|
|
ui_fix_scroll(scr);
|