增加两页UI
This commit is contained in:
@@ -78,7 +78,22 @@ static uint8_t s_row_node[MENU_PAGE_MAX][MENU_ITEM_MAX]; /* 行数据:节
|
||||
static menu_frame_t s_frame[MENU_PAGE_MAX]; /* 每层框几何缓存:位置/尺寸/选中行(现算不落状态,供子框对齐;见上方类型注释) */
|
||||
|
||||
/* 样式(静态,一次性初始化,常驻) */
|
||||
static lv_style_t s_style_flat; /* 通用:透明、无边框/圆角/内边距(剥离主题 card) */
|
||||
/* flat:通用——透明、无边框/圆角/内边距(剥离主题 card)。用常量样式(LV_STYLE_CONST_INIT):
|
||||
* 属性存静态数组、零 LV_MEM 池分配;动态样式首次 set_prop 会从池分配 values_and_props 且永不释放 */
|
||||
static const lv_style_const_prop_t s_flat_props[] = {
|
||||
{ .prop = LV_STYLE_BG_OPA, .value = { .num = LV_OPA_TRANSP } },
|
||||
{ .prop = LV_STYLE_BORDER_WIDTH, .value = { .num = 0 } },
|
||||
{ .prop = LV_STYLE_RADIUS, .value = { .num = 0 } },
|
||||
{ .prop = LV_STYLE_PAD_LEFT, .value = { .num = 0 } },
|
||||
{ .prop = LV_STYLE_PAD_RIGHT, .value = { .num = 0 } },
|
||||
{ .prop = LV_STYLE_PAD_TOP, .value = { .num = 0 } },
|
||||
{ .prop = LV_STYLE_PAD_BOTTOM, .value = { .num = 0 } },
|
||||
{ .prop = LV_STYLE_PAD_ROW, .value = { .num = 0 } },
|
||||
{ .prop = LV_STYLE_PAD_COLUMN, .value = { .num = 0 } },
|
||||
LV_STYLE_CONST_PROPS_END
|
||||
};
|
||||
|
||||
LV_STYLE_CONST_INIT(s_style_flat, s_flat_props);
|
||||
static lv_style_t s_style_frame; /* 框体:透明底 + 1px 白边框 */
|
||||
static lv_style_t s_style_scrollbar; /* 滚动条:白色、4px 宽 */
|
||||
|
||||
@@ -89,7 +104,7 @@ static lv_style_t s_style_scrollbar; /* 滚动条:白色、4px 宽 */
|
||||
* 入口参数:无
|
||||
* 返回值:无
|
||||
* 限定条件:无
|
||||
* 函数说明: 1. flat 剥离主题给对象附加的卡片样式(边框/圆角/内边距)
|
||||
* 函数说明: 1. flat 剥离主题给对象附加的卡片样式(边框/圆角/内边距;常量样式,见上方定义)
|
||||
* 2. frame 为所有级联框(含根框)的 1px 白边框
|
||||
* 3. 选中行反色不用样式:自绘回调按 sel 直接画白带(行不是对象)
|
||||
*/
|
||||
@@ -102,14 +117,6 @@ static void view_styles_init(void) {
|
||||
}
|
||||
inited = true;
|
||||
|
||||
/* flat:透明、无边框/圆角/内边距(剥离主题附加的卡片样式) */
|
||||
lv_style_init(&s_style_flat);
|
||||
lv_style_set_bg_opa(&s_style_flat, LV_OPA_TRANSP);
|
||||
lv_style_set_border_width(&s_style_flat, 0);
|
||||
lv_style_set_radius(&s_style_flat, 0);
|
||||
lv_style_set_pad_all(&s_style_flat, 0);
|
||||
lv_style_set_pad_gap(&s_style_flat, 0);
|
||||
|
||||
/* frame:透明底 + 1px 白边框(所有级联框含根框) */
|
||||
lv_style_init(&s_style_frame);
|
||||
lv_style_set_bg_opa(&s_style_frame, LV_OPA_TRANSP);
|
||||
|
||||
Reference in New Issue
Block a user