Przeglądaj źródła

重构UI,新增 Ui_theme.h 集中管理分层背景、并逐页重做,状态栏加强调色分隔线、就绪徽章改为微染 chip、菜单补上原本缺失的选中高亮,三个页面全部卡片化,温度页拆分了静态描述与动态数值,逻辑层假数据加了波动

zhanghongyi 3 miesięcy temu
rodzic
commit
63484269cc

+ 0 - 1
LVGL8v3/examples/porting/lv_port_indev.h

@@ -3,7 +3,6 @@
  *
  *
  * @brief LVGL 输入设备 (触摸屏) 移植头文件。
  * @brief LVGL 输入设备 (触摸屏) 移植头文件。
  */
  */
-
 #if 1
 #if 1
 
 
 #ifndef LV_PORT_INDEV_H
 #ifndef LV_PORT_INDEV_H

+ 12 - 4
LVGL8v3/logic/Logic_temperature.c

@@ -7,12 +7,14 @@
   ******************************************************************************
   ******************************************************************************
   */
   */
 #include <stdio.h>
 #include <stdio.h>
+#include "lvgl.h"
 #include "Logic_temperature.h"
 #include "Logic_temperature.h"
 
 
 /**
 /**
  * @brief  获取指定通道的温度值
  * @brief  获取指定通道的温度值
- * @note   假数据: 以通道号为基准生成一个随通道变化的温度值,
- *         便于 UI 端直观区分各通道, 后续替换为真实采集数据。
+ * @note   假数据: 以通道号为基准生成一个随通道变化的温度值, 并叠加
+ *         随时间波动的三角波模拟实时采集, 便于 UI 端直观区分与观察刷新;
+ *         后续替换为真实采集数据时删除波动部分即可。
  * @param  ch : 通道号 (0 ~ 31)
  * @param  ch : 通道号 (0 ~ 31)
  * @retval 温度值 (摄氏度), 越界返回 -127
  * @retval 温度值 (摄氏度), 越界返回 -127
  */
  */
@@ -23,8 +25,14 @@ int8_t Logic_temperature_get(uint8_t ch)
         return -127;
         return -127;
     }
     }
 
 
-    /* 假数据: 温度随通道递增偏移, 模拟不同通道的温差 */
-    return (int8_t)(40 + ch);
+    /* 假数据: 温度随通道递增偏移, 叠加随时间缓慢波动的三角波,
+     * 模拟实时采集效果 (后续替换为真实数据源时删除波动即可) */
+    int16_t ph = (int16_t)((lv_tick_get() / 500) % 7);
+    if (ph > 3)
+    {
+        ph = 6 - ph;                       /* 0,1,2,3,2,1,0 往复 */
+    }
+    return (int8_t)(40 + ch + ph - 3);
 }
 }
 
 
 /**
 /**

+ 1 - 1
LVGL8v3/lv_conf.h

@@ -577,7 +577,7 @@
 #if LV_USE_THEME_DEFAULT
 #if LV_USE_THEME_DEFAULT
 
 
     /*0: Light mode; 1: Dark mode*/
     /*0: Light mode; 1: Dark mode*/
-    #define LV_THEME_DEFAULT_DARK 0
+    #define LV_THEME_DEFAULT_DARK 1
 
 
     /*1: Enable grow on press*/
     /*1: Enable grow on press*/
     #define LV_THEME_DEFAULT_GROW 1
     #define LV_THEME_DEFAULT_GROW 1

+ 83 - 30
LVGL8v3/ui/Ui.c

@@ -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);

+ 50 - 17
LVGL8v3/ui/Ui_status.c

@@ -2,15 +2,34 @@
   ******************************************************************************
   ******************************************************************************
   * @file    Ui_status.c
   * @file    Ui_status.c
   * @brief   设备状态页面 (UI 页面层)
   * @brief   设备状态页面 (UI 页面层)
-  *
   ******************************************************************************
   ******************************************************************************
   */
   */
 #include <stdio.h>
 #include <stdio.h>
 #include "Ui_status.h"
 #include "Ui_status.h"
+#include "Ui_theme.h"
 #include "Logic_temperature.h"
 #include "Logic_temperature.h"
 
 
+/* 状态卡片位置 */
+#define UI_STATUS_PANEL_X       10
+#define UI_STATUS_PANEL_Y       48
+#define UI_STATUS_PANEL_W       610
+#define UI_STATUS_PANEL_H       200
+
+/* 行内坐标 */
+#define UI_STATUS_KEY_X         16
+#define UI_STATUS_VALUE_OFF_X   -16
+#define UI_STATUS_ROW_Y0        14      /* 首行 y */
+#define UI_STATUS_ROW_GAP       52      /* 行间距 */
+#define UI_STATUS_LINE_X        16      /* 分隔线 */
+#define UI_STATUS_LINE_W        (UI_STATUS_PANEL_W - 32)
+
 /**
 /**
- * @brief  在父容器内创建一行"标题: 值"的状态项
+ * @brief  在父容器内创建一行\"标题: 值\"的状态项
+ * @param  parent : 父容器
+ * @param  key    : 标题文本
+ * @param  value  : 值文本
+ * @param  y      : 行顶部 y 坐标
+ * @param  value_color : 值颜色
  */
  */
 static void ui_status_add_item(lv_obj_t * parent, const char * key, const char * value,
 static void ui_status_add_item(lv_obj_t * parent, const char * key, const char * value,
                                lv_coord_t y, lv_color_t value_color)
                                lv_coord_t y, lv_color_t value_color)
@@ -18,35 +37,49 @@ static void ui_status_add_item(lv_obj_t * parent, const char * key, const char *
     lv_obj_t * k = lv_label_create(parent);
     lv_obj_t * k = lv_label_create(parent);
     lv_label_set_text(k, key);
     lv_label_set_text(k, key);
     lv_obj_set_style_text_font(k, &lv_font_montserrat_16, LV_STATE_DEFAULT);
     lv_obj_set_style_text_font(k, &lv_font_montserrat_16, LV_STATE_DEFAULT);
-    lv_obj_set_style_text_color(k, lv_color_hex(0xA0A0A0), LV_STATE_DEFAULT);
-    lv_obj_set_pos(k, 10, y);
+    lv_obj_set_style_text_color(k, UI_CLR_TEXT_DIM, LV_STATE_DEFAULT);
+    lv_obj_set_pos(k, UI_STATUS_KEY_X, y);
 
 
     lv_obj_t * v = lv_label_create(parent);
     lv_obj_t * v = lv_label_create(parent);
     lv_label_set_text(v, value);
     lv_label_set_text(v, value);
     lv_obj_set_style_text_font(v, &lv_font_montserrat_16, LV_STATE_DEFAULT);
     lv_obj_set_style_text_font(v, &lv_font_montserrat_16, LV_STATE_DEFAULT);
     lv_obj_set_style_text_color(v, value_color, LV_STATE_DEFAULT);
     lv_obj_set_style_text_color(v, value_color, LV_STATE_DEFAULT);
-    lv_obj_set_pos(v, 200, y);
+    /* 右上对齐: 与键同行右端对齐 (MID 对齐会把所有值堆到面板垂直居中) */
+    lv_obj_align(v, LV_ALIGN_TOP_RIGHT, UI_STATUS_VALUE_OFF_X, y);
 }
 }
 
 
 /**
 /**
- * @brief  在父容器内创建"Device Status"页面
+ * @brief  在父容器内创建\"Device Status\"页面
  * @param  parent : 父容器 (右侧内容区)
  * @param  parent : 父容器 (右侧内容区)
  */
  */
 void Ui_status_create(lv_obj_t * parent)
 void Ui_status_create(lv_obj_t * parent)
 {
 {
-    lv_obj_t * title = lv_label_create(parent);
-    lv_label_set_text(title, "Device Status");
-    lv_obj_set_style_text_font(title, &lv_font_montserrat_20, LV_STATE_DEFAULT);
-    lv_obj_set_style_text_color(title, lv_color_hex(0xFFFFFF), LV_STATE_DEFAULT);
-    lv_obj_set_pos(title, 10, 10);
+    Ui_theme_add_title(parent, "Device Status", 10);
+
+    /* 状态信息卡片 */
+    lv_obj_t * panel = lv_obj_create(parent);
+    lv_obj_set_pos(panel, UI_STATUS_PANEL_X, UI_STATUS_PANEL_Y);
+    lv_obj_set_size(panel, UI_STATUS_PANEL_W, UI_STATUS_PANEL_H);
+    Ui_theme_style_panel(panel);
 
 
     /* 状态信息 (假数据) */
     /* 状态信息 (假数据) */
-    lv_color_t ok_color = lv_color_hex(0x00E000);
-    lv_color_t gray     = lv_color_hex(0xE0E0E0);
+    lv_color_t ok_color = UI_CLR_OK;
+    lv_color_t gray     = UI_CLR_TEXT;
 
 
-    ui_status_add_item(parent, "Status:", "Running", 60, gray);
-    ui_status_add_item(parent, "Power:", "OK", 100, ok_color);      //电源
-    ui_status_add_item(parent, "Comm:", "OK", 140, ok_color);       //通信
-    ui_status_add_item(parent, "Ready:", "Ready", 180, ok_color);
+    ui_status_add_item(panel, "Status:", "Running", UI_STATUS_ROW_Y0 + 0 * UI_STATUS_ROW_GAP, gray);
+    ui_status_add_item(panel, "Power:",  "OK",      UI_STATUS_ROW_Y0 + 1 * UI_STATUS_ROW_GAP, ok_color);
+    ui_status_add_item(panel, "Comm:",   "OK",      UI_STATUS_ROW_Y0 + 2 * UI_STATUS_ROW_GAP, ok_color);
+    ui_status_add_item(panel, "Ready:",  "Ready",   UI_STATUS_ROW_Y0 + 3 * UI_STATUS_ROW_GAP, ok_color);
 
 
+    /* 行间分隔线 (前三行下方) */
+    uint8_t i;
+    for (i = 0; i < 3; i++)
+    {
+        lv_obj_t * line = lv_obj_create(panel);
+        lv_obj_set_pos(line, UI_STATUS_LINE_X, UI_STATUS_ROW_Y0 + (i + 1) * UI_STATUS_ROW_GAP - 18);
+        lv_obj_set_size(line, UI_STATUS_LINE_W, 1);
+        Ui_theme_clear_visuals(line);
+        lv_obj_set_style_bg_color(line, UI_CLR_LINE, LV_STATE_DEFAULT);
+        lv_obj_set_style_bg_opa(line, LV_OPA_COVER, LV_STATE_DEFAULT);
+    }
 }
 }

+ 100 - 54
LVGL8v3/ui/Ui_temp_setting.c

@@ -6,6 +6,7 @@
   */
   */
 #include <stdio.h>
 #include <stdio.h>
 #include "Ui_temp_setting.h"
 #include "Ui_temp_setting.h"
+#include "Ui_theme.h"
 
 
 /* 目标温度范围 */
 /* 目标温度范围 */
 #define UI_TSET_MIN         40
 #define UI_TSET_MIN         40
@@ -19,11 +20,29 @@
 #define UI_TSET_ACC_N       6       /* 每 N 次重复, 步进 +1 */
 #define UI_TSET_ACC_N       6       /* 每 N 次重复, 步进 +1 */
 #define UI_TSET_MAXSTEP     5       /* 最大单次步进 */
 #define UI_TSET_MAXSTEP     5       /* 最大单次步进 */
 
 
-/* 行布局 */
-#define UI_TSET_LABEL_X     20
-#define UI_TSET_BTN_MINUS_X 200
-#define UI_TSET_VAL_X       287
-#define UI_TSET_BTN_PLUS_X  360
+/* 行卡片位置 */
+#define UI_TSET_CARD_X      10
+#define UI_TSET_CARD_W      590
+#define UI_TSET_CARD_H      66
+#define UI_TSET_CARD_GAP    70      /* 卡片起始 y 间距 (CPU0:64, CPU1:134) */
+
+/* 行内坐标 (相对卡片) */
+#define UI_TSET_LABEL_X     16
+#define UI_TSET_LABEL_Y     20
+#define UI_TSET_BTN_Y       12
+#define UI_TSET_BTN_SIZE    48      /* 宽 */
+#define UI_TSET_BTN_H       42
+/* 递减/数值条/递增 以 x=320 为轴左右对称 (按钮宽 48, 数值条宽 90, 间距 16) */
+#define UI_TSET_BTN_MINUS_X 211
+#define UI_TSET_VAL_CHIP_X  275
+#define UI_TSET_VAL_CHIP_W  90
+#define UI_TSET_BTN_PLUS_X  381
+
+/* 按钮区域 */
+#define UI_TSET_APPLY_X     20
+#define UI_TSET_APPLY_Y     240
+#define UI_TSET_HINT_X      170
+#define UI_TSET_HINT_Y      242
 
 
 /* 全局句柄 */
 /* 全局句柄 */
 static int16_t s_target_cpu0 = 60;   /* CPU0 目标温度 (假数据) */
 static int16_t s_target_cpu0 = 60;   /* CPU0 目标温度 (假数据) */
@@ -146,51 +165,66 @@ static void ui_tset_plus_press_cb(lv_event_t * e)
 }
 }
 
 
 /**
 /**
- * @brief  构建一行目标温度设置
- * @param  parent  : 父容器
+ * @brief  构建一个 \"-\"/\"+\" 强调色步进按钮
+ * @param  parent : 父容器 (卡片)
+ * @param  x      : 按钮 x 坐标
+ * @param  ch     : 按钮文字 (\"-\"/\"+\")
+ * @param  which  : 0=CPU0, 1=CPU1
+ * @param  dir    : +1 递增, -1 递减
+ */
+static void ui_tset_build_step_btn(lv_obj_t * parent, lv_coord_t x, const char * ch,
+                                   uint32_t which, int dir)
+{
+    lv_obj_t * btn = lv_btn_create(parent);
+    lv_obj_set_size(btn, UI_TSET_BTN_SIZE, UI_TSET_BTN_H);
+    lv_obj_set_pos(btn, x, UI_TSET_BTN_Y);
+    Ui_theme_style_btn_accent(btn);
+    lv_obj_add_event_cb(btn, (dir > 0) ? ui_tset_plus_press_cb : ui_tset_minus_press_cb,
+                        LV_EVENT_PRESSED, (void *)(uintptr_t)which);
+    lv_obj_add_event_cb(btn, ui_tset_release_cb, LV_EVENT_RELEASED, NULL);
+    lv_obj_add_event_cb(btn, ui_tset_release_cb, LV_EVENT_PRESS_LOST, NULL);
+
+    lv_obj_t * lbl = lv_label_create(btn);
+    lv_label_set_text(lbl, ch);
+    lv_obj_set_style_text_font(lbl, &lv_font_montserrat_20, LV_STATE_DEFAULT);
+    lv_obj_set_style_text_color(lbl, UI_CLR_ACCENT_DARK, LV_STATE_DEFAULT);
+    lv_obj_center(lbl);
+}
+
+/**
+ * @brief  构建一行目标温度设置 (名称 + 递减 + 数值条 + 递增)
+ * @param  parent  : 父容器 (卡片)
  * @param  name    : CPU 名称 (CPU0/CPU1)
  * @param  name    : CPU 名称 (CPU0/CPU1)
  * @param  which   : 0=CPU0, 1=CPU1
  * @param  which   : 0=CPU0, 1=CPU1
- * @param  y       : 行顶部 y 坐标
  * @param  val_ptr : 指向数值标签句柄
  * @param  val_ptr : 指向数值标签句柄
  */
  */
 static void ui_tset_add_row(lv_obj_t * parent, const char * name, uint32_t which,
 static void ui_tset_add_row(lv_obj_t * parent, const char * name, uint32_t which,
-                            lv_coord_t y, lv_obj_t ** val_ptr)
+                            lv_obj_t ** val_ptr)
 {
 {
     /* 名称 */
     /* 名称 */
     lv_obj_t * lbl = lv_label_create(parent);
     lv_obj_t * lbl = lv_label_create(parent);
     lv_label_set_text(lbl, name);
     lv_label_set_text(lbl, name);
     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, lv_color_hex(0xE0E0E0), LV_STATE_DEFAULT);
-    lv_obj_set_pos(lbl, UI_TSET_LABEL_X, y);
-
-    /* 递减按钮 "-" (长按自动减) */
-    lv_obj_t * minus = lv_btn_create(parent);
-    lv_obj_set_size(minus, 48, 40);
-    lv_obj_set_pos(minus, UI_TSET_BTN_MINUS_X, y - 6);
-    lv_obj_add_event_cb(minus, ui_tset_minus_press_cb, LV_EVENT_PRESSED, (void *)(uintptr_t)which);
-    lv_obj_add_event_cb(minus, ui_tset_release_cb, LV_EVENT_RELEASED, NULL);
-    lv_obj_add_event_cb(minus, ui_tset_release_cb, LV_EVENT_PRESS_LOST, NULL);
-    lv_obj_t * ml = lv_label_create(minus);
-    lv_label_set_text(ml, "-");
-    lv_obj_center(ml);
-
-    /* 数值标签 */
-    lv_obj_t * val = lv_label_create(parent);
+    lv_obj_set_style_text_color(lbl, UI_CLR_TEXT, LV_STATE_DEFAULT);
+    lv_obj_set_pos(lbl, UI_TSET_LABEL_X, UI_TSET_LABEL_Y);
+
+    /* 递减按钮 \"-\" (长按自动减) */
+    ui_tset_build_step_btn(parent, UI_TSET_BTN_MINUS_X, "-", which, -1);
+
+    /* 数值条: 深色圆角底 + 白色数值 */
+    lv_obj_t * chip = lv_obj_create(parent);
+    lv_obj_set_pos(chip, UI_TSET_VAL_CHIP_X, UI_TSET_BTN_Y);
+    lv_obj_set_size(chip, UI_TSET_VAL_CHIP_W, UI_TSET_BTN_H);
+    Ui_theme_style_chip(chip);
+
+    lv_obj_t * val = lv_label_create(chip);
     lv_obj_set_style_text_font(val, &lv_font_montserrat_20, LV_STATE_DEFAULT);
     lv_obj_set_style_text_font(val, &lv_font_montserrat_20, LV_STATE_DEFAULT);
-    lv_obj_set_style_text_color(val, lv_color_hex(0xFFFFFF), LV_STATE_DEFAULT);
-    lv_obj_set_pos(val, UI_TSET_VAL_X, y);
+    lv_obj_set_style_text_color(val, UI_CLR_TEXT, LV_STATE_DEFAULT);
+    lv_obj_center(val);
     *val_ptr = val;
     *val_ptr = val;
 
 
-    /* 递增按钮 "+" (长按自动加) */
-    lv_obj_t * plus = lv_btn_create(parent);
-    lv_obj_set_size(plus, 48, 40);
-    lv_obj_set_pos(plus, UI_TSET_BTN_PLUS_X, y - 6);
-    lv_obj_add_event_cb(plus, ui_tset_plus_press_cb, LV_EVENT_PRESSED, (void *)(uintptr_t)which);
-    lv_obj_add_event_cb(plus, ui_tset_release_cb, LV_EVENT_RELEASED, NULL);
-    lv_obj_add_event_cb(plus, ui_tset_release_cb, LV_EVENT_PRESS_LOST, NULL);
-    lv_obj_t * pl = lv_label_create(plus);
-    lv_label_set_text(pl, "+");
-    lv_obj_center(pl);
+    /* 递增按钮 \"+\" (长按自动加) */
+    ui_tset_build_step_btn(parent, UI_TSET_BTN_PLUS_X, "+", which, +1);
 }
 }
 
 
 /**
 /**
@@ -203,37 +237,49 @@ static void ui_tset_apply_cb(lv_event_t * e)
 }
 }
 
 
 /**
 /**
- * @brief  在父容器内创建"温度设置"页面
+ * @brief  在父容器内创建\"温度设置\"页面
  * @param  parent : 父容器 (右侧内容区)
  * @param  parent : 父容器 (右侧内容区)
  */
  */
 void Ui_temp_setting_create(lv_obj_t * parent)
 void Ui_temp_setting_create(lv_obj_t * parent)
 {
 {
-    lv_obj_t * title = lv_label_create(parent);
-    lv_label_set_text(title, "Temperature Setting");
-    lv_obj_set_style_text_font(title, &lv_font_montserrat_20, LV_STATE_DEFAULT);
-    lv_obj_set_style_text_color(title, lv_color_hex(0xFFFFFF), LV_STATE_DEFAULT);
-    lv_obj_set_pos(title, 10, 10);
+    Ui_theme_add_title(parent, "Temperature Setting", 10);
+
+    /* CPU0 目标温度卡片 */
+    lv_obj_t * card0 = lv_obj_create(parent);
+    lv_obj_set_pos(card0, UI_TSET_CARD_X, UI_TSET_CARD_GAP - 6);
+    lv_obj_set_size(card0, UI_TSET_CARD_W, UI_TSET_CARD_H);
+    Ui_theme_style_panel(card0);
+    ui_tset_add_row(card0, "CPU0 Target:", 0, &s_val_cpu0);
 
 
-    /* CPU0 / CPU1 目标温度行 */
-    ui_tset_add_row(parent, "CPU0 Target:", 0, 80, &s_val_cpu0);
-    ui_tset_add_row(parent, "CPU1 Target:", 1, 150, &s_val_cpu1);
+    /* CPU1 目标温度卡片 */
+    lv_obj_t * card1 = lv_obj_create(parent);
+    lv_obj_set_pos(card1, UI_TSET_CARD_X, UI_TSET_CARD_GAP * 2 - 6);
+    lv_obj_set_size(card1, UI_TSET_CARD_W, UI_TSET_CARD_H);
+    Ui_theme_style_panel(card1);
+    ui_tset_add_row(card1, "CPU1 Target:", 1, &s_val_cpu1);
 
 
-    /* Apply 按钮 */
+    /* Apply 按钮 (强调色) */
     lv_obj_t * apply = lv_btn_create(parent);
     lv_obj_t * apply = lv_btn_create(parent);
-    lv_obj_set_size(apply, 120, 44);
-    lv_obj_set_pos(apply, UI_TSET_LABEL_X, 240);
+    lv_obj_set_size(apply, 130, 44);
+    lv_obj_set_pos(apply, UI_TSET_APPLY_X, UI_TSET_APPLY_Y);
     lv_obj_add_event_cb(apply, ui_tset_apply_cb, LV_EVENT_CLICKED, NULL);
     lv_obj_add_event_cb(apply, ui_tset_apply_cb, LV_EVENT_CLICKED, NULL);
+    Ui_theme_style_btn_accent(apply);
     lv_obj_t * al = lv_label_create(apply);
     lv_obj_t * al = lv_label_create(apply);
     lv_label_set_text(al, "Apply");
     lv_label_set_text(al, "Apply");
     lv_obj_set_style_text_font(al, &lv_font_montserrat_16, LV_STATE_DEFAULT);
     lv_obj_set_style_text_font(al, &lv_font_montserrat_16, LV_STATE_DEFAULT);
+    lv_obj_set_style_text_color(al, UI_CLR_ACCENT_DARK, LV_STATE_DEFAULT);
     lv_obj_center(al);
     lv_obj_center(al);
 
 
-    /* 范围说明 */
-    lv_obj_t * hint = lv_label_create(parent);
-    lv_label_set_text(hint, "Range: 40 ~ 90 degree centigrade");
+    /* 范围说明 (信息条) */
+    lv_obj_t * hint_chip = lv_obj_create(parent);
+    lv_obj_set_pos(hint_chip, UI_TSET_HINT_X, UI_TSET_HINT_Y);
+    lv_obj_set_size(hint_chip, 260, 44);
+    Ui_theme_style_chip(hint_chip);
+    lv_obj_t * hint = lv_label_create(hint_chip);
+    lv_label_set_text(hint, "Range: 40 ~ 90 deg C");
     lv_obj_set_style_text_font(hint, &lv_font_montserrat_14, LV_STATE_DEFAULT);
     lv_obj_set_style_text_font(hint, &lv_font_montserrat_14, LV_STATE_DEFAULT);
-    lv_obj_set_style_text_color(hint, lv_color_hex(0x808080), LV_STATE_DEFAULT);
-    lv_obj_set_pos(hint, UI_TSET_LABEL_X, 210);
+    lv_obj_set_style_text_color(hint, UI_CLR_TEXT_MUTED, LV_STATE_DEFAULT);
+    lv_obj_center(hint);
 
 
     /* 初始显示 */
     /* 初始显示 */
     ui_tset_refresh();
     ui_tset_refresh();

+ 130 - 46
LVGL8v3/ui/Ui_temperature.c

@@ -6,6 +6,7 @@
   */
   */
 #include <stdio.h>
 #include <stdio.h>
 #include "Ui_temperature.h"
 #include "Ui_temperature.h"
+#include "Ui_theme.h"
 #include "Logic_temperature.h"
 #include "Logic_temperature.h"
 
 
 /* 每页显示的通道数 = 4 行 x 2 列 = 8 条 */
 /* 每页显示的通道数 = 4 行 x 2 列 = 8 条 */
@@ -13,26 +14,52 @@
 #define UI_TEMP_ROW_CNT         4
 #define UI_TEMP_ROW_CNT         4
 #define UI_TEMP_COL_CNT         2
 #define UI_TEMP_COL_CNT         2
 
 
-/* 左侧箭头 / 右侧箭头宽度 */
+/* 实时刷新周期 (ms) */
+#define UI_TEMP_REFRESH_MS      500
+
+/* 左右箭头导航按钮 (与数据卡片等高) */
+#define UI_TEMP_NAV_X           10
 #define UI_TEMP_NAV_W           70
 #define UI_TEMP_NAV_W           70
+#define UI_TEMP_NAV_Y           UI_TEMP_PANEL_Y
+#define UI_TEMP_NAV_H           UI_TEMP_PANEL_H
+
+/* 导航按钮与数据卡片之间的间隔 (左右一致) */
+#define UI_TEMP_GAP             20
 
 
-/* 数据区行列位置 */
-#define UI_TEMP_SW_X1           110
-#define UI_TEMP_SW_X2           350
-#define UI_TEMP_SW_Y_BASE       50
-#define UI_TEMP_SW_H            95
+/* 数据卡片位置 (左右留白一致, 与导航按钮间隔一致) */
+#define UI_TEMP_PANEL_X         (UI_TEMP_NAV_X + UI_TEMP_NAV_W + UI_TEMP_GAP)   /* 100 */
+#define UI_TEMP_PANEL_Y         44
+#define UI_TEMP_PANEL_W         430
+#define UI_TEMP_PANEL_H         388
+#define UI_TEMP_NAV_RIGHT_X     (UI_TEMP_PANEL_X + UI_TEMP_PANEL_W + UI_TEMP_GAP) /* 550 */
+
+/* 数据区行列位置 (相对数据卡片) */
+#define UI_TEMP_SW_X1           18
+#define UI_TEMP_SW_X2           248
+#define UI_TEMP_SW_Y_BASE       46
+#define UI_TEMP_SW_H            90
 
 
 /* 色卡尺寸 */
 /* 色卡尺寸 */
 #define UI_TEMP_SW_SIZE         22
 #define UI_TEMP_SW_SIZE         22
 
 
+/* 卡片底部: 分隔线 + 页码指示条 */
+#define UI_TEMP_FOOTER_Y        348
+#define UI_TEMP_CHIP_W          60
+#define UI_TEMP_CHIP_H          28
+
 /* 全局句柄 */
 /* 全局句柄 */
-static lv_obj_t * s_temp_labels[UI_TEMP_PAGE_NUM];   /* 8 个温度数据标签 */
-static lv_obj_t * s_temp_swatch[UI_TEMP_PAGE_NUM];   /* 8 个色卡 */
-static lv_obj_t * s_page_label  = NULL;              /* 页码指示 (如 1/4) */
-static uint8_t    s_page_start  = 0;                 /* 当前页起始通道 (0/8/16/24) */
+static lv_obj_t * s_temp_value[UI_TEMP_PAGE_NUM];  /* 8 个动态数值标签 (温度) */
+static lv_obj_t * s_temp_swatch[UI_TEMP_PAGE_NUM]; /* 8 个色卡 */
+static lv_obj_t * s_page_label  = NULL;            /* 页码指示 (如 1/4) */
+static lv_timer_t * s_temp_timer = NULL;           /* 实时刷新定时器 */
+static uint8_t    s_page_start  = 0;               /* 当前页起始通道 (0/8/16/24) */
 
 
-/* 上一页 / 下一页最大起始通道 */
+/* 数值标签的静态缓冲区 (lv_label_set_text_static 不重新分配内存) */
+static char s_value_buf[UI_TEMP_PAGE_NUM][8];
+
+/* 翻页步长: 每页 8 个通道 */
 #define UI_TEMP_PAGE_STEP       8
 #define UI_TEMP_PAGE_STEP       8
+/* 最大起始通道 (共 32 通道, 每页 8 条, 末页起始 = 32 - 8 = 24) */
 #define UI_TEMP_PAGE_MAX        (LOGIC_TEMP_TOTAL_CH - UI_TEMP_PAGE_NUM)   /* 24 */
 #define UI_TEMP_PAGE_MAX        (LOGIC_TEMP_TOTAL_CH - UI_TEMP_PAGE_NUM)   /* 24 */
 
 
 /**
 /**
@@ -47,21 +74,18 @@ static lv_color_t ui_temp_ch_color(uint8_t ch)
 }
 }
 
 
 /**
 /**
- * @brief  刷新当前页的温度数据显示
+ * @brief  刷新当前页的温度数据显示 (只更新动态数值与色卡, 描述标签不变)
  */
  */
 static void ui_temp_refresh(void)
 static void ui_temp_refresh(void)
 {
 {
     uint8_t i;
     uint8_t i;
     for (i = 0; i < UI_TEMP_PAGE_NUM; i++)
     for (i = 0; i < UI_TEMP_PAGE_NUM; i++)
     {
     {
-        uint8_t ch     = s_page_start + i;              /* 全局通道号 */
-        int8_t  cpu    = Logic_temperature_get_cpu(ch); /* 0=CPU0, 1=CPU1 */
-        uint8_t ch_in  = (uint8_t)(ch % LOGIC_TEMP_CPU_CH_COUNT) + 1;  /* CPU 内 1~16 */
-        int8_t  t      = Logic_temperature_get(ch);
-        char buf[24];
+        uint8_t ch = s_page_start + i;              /* 全局通道号 */
+        int8_t  t  = Logic_temperature_get(ch);
 
 
-        snprintf(buf, sizeof(buf), "CPU%d CH%d: %d", (int)cpu, (int)ch_in, (int)t);
-        lv_label_set_text(s_temp_labels[i], buf);
+        snprintf(s_value_buf[i], sizeof(s_value_buf[i]), "%d", (int)t);
+        lv_label_set_text_static(s_temp_value[i], s_value_buf[i]);
 
 
         /* 色卡: 固定通道色 */
         /* 色卡: 固定通道色 */
         lv_obj_set_style_bg_color(s_temp_swatch[i], ui_temp_ch_color(ch), LV_STATE_DEFAULT);
         lv_obj_set_style_bg_color(s_temp_swatch[i], ui_temp_ch_color(ch), LV_STATE_DEFAULT);
@@ -78,6 +102,28 @@ static void ui_temp_refresh(void)
     }
     }
 }
 }
 
 
+/**
+ * @brief  实时刷新定时器回调
+ */
+static void ui_temp_timer_cb(lv_timer_t * t)
+{
+    (void)t;
+    ui_temp_refresh();
+}
+
+/**
+ * @brief  页面被销毁 (切换菜单) 时释放实时刷新定时器
+ */
+static void ui_temp_delete_cb(lv_event_t * e)
+{
+    (void)e;
+    if (s_temp_timer != NULL)
+    {
+        lv_timer_del(s_temp_timer);
+        s_temp_timer = NULL;
+    }
+}
+
 /**
 /**
  * @brief  左箭头按钮事件回调: 上一页
  * @brief  左箭头按钮事件回调: 上一页
  */
  */
@@ -123,13 +169,16 @@ static void ui_temp_build_nav_btn(lv_obj_t * parent, const char * ch, lv_coord_t
                                   lv_event_cb_t cb)
                                   lv_event_cb_t cb)
 {
 {
     lv_obj_t * btn = lv_btn_create(parent);
     lv_obj_t * btn = lv_btn_create(parent);
-    lv_obj_set_size(btn, UI_TEMP_NAV_W, 200);
-    lv_obj_set_pos(btn, x, 100);
+    lv_obj_set_size(btn, UI_TEMP_NAV_W, UI_TEMP_NAV_H);
+    lv_obj_set_pos(btn, x, UI_TEMP_NAV_Y);
     lv_obj_add_event_cb(btn, cb, LV_EVENT_CLICKED, NULL);
     lv_obj_add_event_cb(btn, cb, LV_EVENT_CLICKED, NULL);
+    Ui_theme_style_btn(btn);
 
 
     lv_obj_t * lbl = lv_label_create(btn);
     lv_obj_t * lbl = lv_label_create(btn);
     lv_label_set_text(lbl, ch);
     lv_label_set_text(lbl, ch);
-    lv_obj_set_style_text_font(lbl, &lv_font_montserrat_16, LV_STATE_DEFAULT);
+    lv_obj_set_style_text_font(lbl, &lv_font_montserrat_20, LV_STATE_DEFAULT);
+    lv_obj_set_style_text_color(lbl, UI_CLR_TEXT, 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);
 }
 }
 
 
@@ -141,53 +190,88 @@ void Ui_temperature_create(lv_obj_t * parent)
 {
 {
     uint8_t r, c, i = 0;
     uint8_t r, c, i = 0;
 
 
+    /* 重新进入页面时回到第一页 (必须在构建描述标签前复位) */
+    s_page_start = 0;
+
+    /* 页面标题 */
+    Ui_theme_add_title(parent, "Real-time Temperature", 10);
+
     /* 左侧"上一页"整列箭头 */
     /* 左侧"上一页"整列箭头 */
-    ui_temp_build_nav_btn(parent, LV_SYMBOL_LEFT, 10, ui_temp_prev_cb);
+    ui_temp_build_nav_btn(parent, LV_SYMBOL_LEFT, UI_TEMP_NAV_X, ui_temp_prev_cb);
 
 
     /* 右侧"下一页"整列箭头 */
     /* 右侧"下一页"整列箭头 */
-    ui_temp_build_nav_btn(parent, LV_SYMBOL_RIGHT, 545, ui_temp_next_cb);
+    ui_temp_build_nav_btn(parent, LV_SYMBOL_RIGHT, UI_TEMP_NAV_RIGHT_X, ui_temp_next_cb);
+
+    /* 中间数据卡片: 4 行 x 2 列 共 8 条温度数据 (每条: 色卡 + 描述 + 数值) */
+    lv_obj_t * panel = lv_obj_create(parent);
+    lv_obj_set_pos(panel, UI_TEMP_PANEL_X, UI_TEMP_PANEL_Y);
+    lv_obj_set_size(panel, UI_TEMP_PANEL_W, UI_TEMP_PANEL_H);
+    Ui_theme_style_panel(panel);
+
+    /* 页面销毁时释放定时器 */
+    lv_obj_add_event_cb(panel, ui_temp_delete_cb, LV_EVENT_DELETE, NULL);
 
 
-    /* 中间 4 行 x 2 列 共 8 条温度数据 (每条: 色卡 + 文本) */
     for (r = 0; r < UI_TEMP_ROW_CNT; r++)
     for (r = 0; r < UI_TEMP_ROW_CNT; r++)
     {
     {
         for (c = 0; c < UI_TEMP_COL_CNT; c++)
         for (c = 0; c < UI_TEMP_COL_CNT; c++)
         {
         {
             lv_coord_t x = (c == 0) ? UI_TEMP_SW_X1 : UI_TEMP_SW_X2;
             lv_coord_t x = (c == 0) ? UI_TEMP_SW_X1 : UI_TEMP_SW_X2;
             lv_coord_t y = UI_TEMP_SW_Y_BASE + r * UI_TEMP_SW_H;
             lv_coord_t y = UI_TEMP_SW_Y_BASE + r * UI_TEMP_SW_H;
+            uint8_t  ch     = s_page_start + i;             /* 全局通道号 */
+            int8_t   cpu    = Logic_temperature_get_cpu(ch);
+            uint8_t  ch_in  = (uint8_t)(ch % LOGIC_TEMP_CPU_CH_COUNT) + 1;  /* CPU 内 1~16 */
+            char     desc[16];
 
 
-            /* 色卡 (固定通道色的纯色圆点, 清除全部默认主题视觉) */
-            lv_obj_t * sw = lv_obj_create(parent);
+            /* 色卡 (固定通道色的纯色圆点) */
+            lv_obj_t * sw = lv_obj_create(panel);
             lv_obj_set_size(sw, UI_TEMP_SW_SIZE, UI_TEMP_SW_SIZE);
             lv_obj_set_size(sw, UI_TEMP_SW_SIZE, UI_TEMP_SW_SIZE);
             lv_obj_set_pos(sw, x, y);
             lv_obj_set_pos(sw, x, y);
             lv_obj_set_style_radius(sw, LV_RADIUS_CIRCLE, LV_STATE_DEFAULT);
             lv_obj_set_style_radius(sw, LV_RADIUS_CIRCLE, LV_STATE_DEFAULT);
             lv_obj_set_style_bg_opa(sw, LV_OPA_COVER, LV_STATE_DEFAULT);
             lv_obj_set_style_bg_opa(sw, LV_OPA_COVER, LV_STATE_DEFAULT);
-            lv_obj_set_style_border_width(sw, 0, LV_STATE_DEFAULT);
-            lv_obj_set_style_border_opa(sw, LV_OPA_TRANSP, LV_STATE_DEFAULT);
-            lv_obj_set_style_shadow_width(sw, 0, LV_STATE_DEFAULT);
-            lv_obj_set_style_shadow_opa(sw, LV_OPA_TRANSP, LV_STATE_DEFAULT);
-            lv_obj_set_style_outline_width(sw, 0, LV_STATE_DEFAULT);
-            lv_obj_set_style_pad_all(sw, 0, LV_STATE_DEFAULT);
-            lv_obj_clear_flag(sw, LV_OBJ_FLAG_SCROLLABLE);
-            lv_obj_set_scrollbar_mode(sw, LV_SCROLLBAR_MODE_OFF);
+            Ui_theme_clear_visuals(sw);
             s_temp_swatch[i] = sw;
             s_temp_swatch[i] = sw;
 
 
-            /* 文字: "CPUx CHn: 温度" */
-            lv_obj_t * lbl = lv_label_create(parent);
-            lv_obj_set_pos(lbl, x + UI_TEMP_SW_SIZE + 10, y);
-            lv_obj_set_style_text_font(lbl, &lv_font_montserrat_20, LV_STATE_DEFAULT);
-            lv_obj_set_style_text_color(lbl, lv_color_hex(0xE0E0E0), LV_STATE_DEFAULT);
-            s_temp_labels[i] = lbl;
+            /* 静态描述: "CPUx CHn:" (只创建一次, 不再变化) */
+            snprintf(desc, sizeof(desc), "CPU%d CH%d:", (int)cpu, (int)ch_in);
+            lv_obj_t * d = lv_label_create(panel);
+            lv_label_set_text(d, desc);
+            lv_obj_set_pos(d, x + UI_TEMP_SW_SIZE + 10, y);
+            lv_obj_set_style_text_font(d, &lv_font_montserrat_16, LV_STATE_DEFAULT);
+            lv_obj_set_style_text_color(d, UI_CLR_TEXT_DIM, LV_STATE_DEFAULT);
+
+            /* 动态数值: 紧跟在描述后, 强调色, 实时刷新 */
+            lv_obj_t * v = lv_label_create(panel);
+            lv_obj_set_style_text_font(v, &lv_font_montserrat_16, LV_STATE_DEFAULT);
+            lv_obj_set_style_text_color(v, UI_CLR_ACCENT, LV_STATE_DEFAULT);
+            lv_obj_align_to(v, d, LV_ALIGN_OUT_RIGHT_MID, 4, 0);
+            s_temp_value[i] = v;
             i++;
             i++;
         }
         }
     }
     }
 
 
-    /* 页码指示 (右下角) */
-    s_page_label = lv_label_create(parent);
+    /* 卡片底部: 分隔线 */
+    lv_obj_t * footer_line = lv_obj_create(panel);
+    lv_obj_set_pos(footer_line, 14, UI_TEMP_FOOTER_Y);
+    lv_obj_set_size(footer_line, UI_TEMP_PANEL_W - 28, 1);
+    Ui_theme_clear_visuals(footer_line);
+    lv_obj_set_style_bg_color(footer_line, UI_CLR_LINE, LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_opa(footer_line, LV_OPA_COVER, LV_STATE_DEFAULT);
+
+    /* 页码指示条 (卡片底部正中, 带边框) */
+    lv_obj_t * page_chip = lv_obj_create(panel);
+    lv_obj_set_size(page_chip, UI_TEMP_CHIP_W, UI_TEMP_CHIP_H);
+    lv_obj_align(page_chip, LV_ALIGN_BOTTOM_MID, 0, -8);
+    Ui_theme_style_chip(page_chip);
+
+    s_page_label = lv_label_create(page_chip);
     lv_obj_set_style_text_font(s_page_label, &lv_font_montserrat_16, LV_STATE_DEFAULT);
     lv_obj_set_style_text_font(s_page_label, &lv_font_montserrat_16, LV_STATE_DEFAULT);
-    lv_obj_set_style_text_color(s_page_label, lv_color_hex(0x808080), LV_STATE_DEFAULT);
-    lv_obj_align(s_page_label, LV_ALIGN_BOTTOM_RIGHT, -20, -10);
+    lv_obj_set_style_text_color(s_page_label, UI_CLR_ACCENT, LV_STATE_DEFAULT);
+    lv_obj_center(s_page_label);
 
 
     /* 初始显示 */
     /* 初始显示 */
-    s_page_start = 0;
     ui_temp_refresh();
     ui_temp_refresh();
+
+    /* 启动实时刷新定时器 (页面存在期间每 500ms 刷新一次) */
+    s_temp_timer = lv_timer_create(ui_temp_timer_cb, UI_TEMP_REFRESH_MS, NULL);
+    lv_timer_set_repeat_count(s_temp_timer, -1);
 }
 }

+ 166 - 0
LVGL8v3/ui/Ui_theme.h

@@ -0,0 +1,166 @@
+/**
+  ******************************************************************************
+  * @file    Ui_theme.h
+  * @brief   UI 主题定义 (深色工业风统一色板 + 通用样式助手)
+  *
+  * @note    采用头文件 + static inline 的实现方式, 无需新增源文件,
+  *          各页面直接调用即可保证全局配色与控件风格一致。
+  ******************************************************************************
+  */
+#ifndef __UI_THEME_H
+#define __UI_THEME_H
+
+#include "lvgl.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*----------------------------- 色板 ------------------------------*/
+#define UI_CLR_BG           lv_color_hex(0x0E1216)   /* 屏幕/内容区背景 */
+#define UI_CLR_MENU         lv_color_hex(0x12181E)   /* 左侧菜单背景 */
+#define UI_CLR_STATUS_BAR   lv_color_hex(0x11161C)   /* 顶部状态栏背景 */
+#define UI_CLR_PANEL        lv_color_hex(0x151B21)   /* 卡片面板背景 */
+#define UI_CLR_PANEL_HI     lv_color_hex(0x1C242D)   /* 凸起元素/按钮底色 */
+#define UI_CLR_LINE         lv_color_hex(0x26313C)   /* 分隔线/描边 */
+
+#define UI_CLR_ACCENT       lv_color_hex(0x00B4D8)   /* 主强调色 (青色) */
+#define UI_CLR_ACCENT_HI    lv_color_hex(0x33C8E6)   /* 强调色高亮 (按下) */
+#define UI_CLR_ACCENT_DARK  lv_color_hex(0x062B33)   /* 强调色上的深色文字 */
+
+#define UI_CLR_TEXT         lv_color_hex(0xDCE4EC)   /* 主文字 */
+#define UI_CLR_TEXT_DIM     lv_color_hex(0x93A1B0)   /* 次要文字 */
+#define UI_CLR_TEXT_MUTED   lv_color_hex(0x5F6C7A)   /* 弱化文字 */
+
+#define UI_CLR_OK           lv_color_hex(0x2ECC71)   /* 正常/就绪 */
+#define UI_CLR_ERR          lv_color_hex(0xE74C3C)   /* 异常/未就绪 */
+
+/*----------------------------- 样式助手 ------------------------------*/
+
+/**
+ * @brief  清除对象默认主题视觉 (边框/阴影/描边/内边距/滚动), 用于纯色小元素
+ * @param  obj : 目标对象
+ */
+static inline void Ui_theme_clear_visuals(lv_obj_t * obj)
+{
+    lv_obj_set_style_border_width(obj, 0, LV_STATE_DEFAULT);
+    lv_obj_set_style_border_opa(obj, LV_OPA_TRANSP, LV_STATE_DEFAULT);
+    lv_obj_set_style_shadow_width(obj, 0, LV_STATE_DEFAULT);
+    lv_obj_set_style_shadow_opa(obj, LV_OPA_TRANSP, LV_STATE_DEFAULT);
+    lv_obj_set_style_outline_width(obj, 0, LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_all(obj, 0, LV_STATE_DEFAULT);
+    lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
+    lv_obj_set_scrollbar_mode(obj, LV_SCROLLBAR_MODE_OFF);
+}
+
+/**
+ * @brief  卡片面板: 圆角 + 深色底 + 细描边
+ * @param  obj : 目标对象
+ */
+static inline void Ui_theme_style_panel(lv_obj_t * obj)
+{
+    lv_obj_set_style_radius(obj, 10, LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_color(obj, UI_CLR_PANEL, LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_opa(obj, LV_OPA_COVER, LV_STATE_DEFAULT);
+    lv_obj_set_style_border_width(obj, 1, LV_STATE_DEFAULT);
+    lv_obj_set_style_border_color(obj, UI_CLR_LINE, LV_STATE_DEFAULT);
+    lv_obj_set_style_shadow_width(obj, 0, LV_STATE_DEFAULT);
+    lv_obj_set_style_shadow_opa(obj, LV_OPA_TRANSP, LV_STATE_DEFAULT);
+    lv_obj_set_style_outline_width(obj, 0, LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_all(obj, 0, LV_STATE_DEFAULT);
+    lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
+    lv_obj_set_scrollbar_mode(obj, LV_SCROLLBAR_MODE_OFF);
+}
+
+/**
+ * @brief  普通按钮: 深色底 + 细描边, 按下变为强调色
+ * @param  btn : 按钮对象
+ */
+static inline void Ui_theme_style_btn(lv_obj_t * btn)
+{
+    lv_obj_set_style_radius(btn, 8, LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_color(btn, UI_CLR_PANEL_HI, LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_opa(btn, LV_OPA_COVER, LV_STATE_DEFAULT);
+    lv_obj_set_style_border_width(btn, 1, LV_STATE_DEFAULT);
+    lv_obj_set_style_border_color(btn, UI_CLR_LINE, 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);
+    lv_obj_set_style_border_color(btn, UI_CLR_ACCENT, LV_STATE_PRESSED);
+    lv_obj_clear_flag(btn, LV_OBJ_FLAG_SCROLLABLE);
+    lv_obj_set_scrollbar_mode(btn, LV_SCROLLBAR_MODE_OFF);
+}
+
+/**
+ * @brief  强调色按钮: 青色实底 + 深色文字
+ * @note   按下样式色值取更亮的 ACCENT_HI, 经默认主题按压缩暗滤镜
+ *         (35% 暗化) 后呈现"按下变暗"的反馈效果
+ * @param  btn : 按钮对象
+ */
+static inline void Ui_theme_style_btn_accent(lv_obj_t * btn)
+{
+    lv_obj_set_style_radius(btn, 8, LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_color(btn, UI_CLR_ACCENT, 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_HI, LV_STATE_PRESSED);
+    lv_obj_clear_flag(btn, LV_OBJ_FLAG_SCROLLABLE);
+    lv_obj_set_scrollbar_mode(btn, LV_SCROLLBAR_MODE_OFF);
+}
+
+/**
+ * @brief  小圆角信息条 (chip): 深色底 + 细描边
+ * @param  obj : 目标对象
+ */
+static inline void Ui_theme_style_chip(lv_obj_t * obj)
+{
+    lv_obj_set_style_radius(obj, LV_RADIUS_CIRCLE, LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_color(obj, UI_CLR_PANEL_HI, LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_opa(obj, LV_OPA_COVER, LV_STATE_DEFAULT);
+    lv_obj_set_style_border_width(obj, 1, LV_STATE_DEFAULT);
+    lv_obj_set_style_border_color(obj, UI_CLR_LINE, LV_STATE_DEFAULT);
+    lv_obj_set_style_shadow_width(obj, 0, LV_STATE_DEFAULT);
+    lv_obj_set_style_shadow_opa(obj, LV_OPA_TRANSP, LV_STATE_DEFAULT);
+    lv_obj_set_style_outline_width(obj, 0, LV_STATE_DEFAULT);
+    lv_obj_set_style_pad_all(obj, 0, LV_STATE_DEFAULT);
+    lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
+    lv_obj_set_scrollbar_mode(obj, LV_SCROLLBAR_MODE_OFF);
+}
+
+/**
+ * @brief  页面标题: 强调色竖条 + 标题文字
+ * @param  parent : 父容器
+ * @param  text   : 标题文本
+ * @param  y      : 标题顶部 y 坐标
+ */
+static inline void Ui_theme_add_title(lv_obj_t * parent, const char * text, lv_coord_t y)
+{
+    /* 强调色竖条 */
+    lv_obj_t * tick = lv_obj_create(parent);
+    lv_obj_set_size(tick, 4, 22);
+    lv_obj_set_pos(tick, 10, y);
+    Ui_theme_clear_visuals(tick);
+    lv_obj_set_style_radius(tick, 2, LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_color(tick, UI_CLR_ACCENT, LV_STATE_DEFAULT);
+    lv_obj_set_style_bg_opa(tick, LV_OPA_COVER, LV_STATE_DEFAULT);
+
+    /* 标题文字 */
+    lv_obj_t * title = lv_label_create(parent);
+    lv_label_set_text(title, text);
+    lv_obj_set_style_text_font(title, &lv_font_montserrat_20, LV_STATE_DEFAULT);
+    lv_obj_set_style_text_color(title, UI_CLR_TEXT, LV_STATE_DEFAULT);
+    lv_obj_set_pos(title, 24, y);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __UI_THEME_H */