feat(bt): 批③后台管理页UI按钮化 — 每行右'杀'按钮(bgm_btn_rect精确命中,行区不误杀)+顶栏'一键清除后台'按钮(sub_page_t增row_draw/row_tap/top_action/top_action_cb全NULL守卫,wifi/bt/lock行为不变);test_bgpage 32项ALL PASS,0warning

This commit is contained in:
AskaEth committed 2026-09-04 02:48:08 +08:00
1 parent c69fb92284
commit 5c174224f7
4 files changed
+324 -43

No files matched your search

@@ -493,6 +493,18 @@ typedef struct sub_page {
int (*detail)(void *ctx, int idx, int act);/* 点 SUB_ROW 行(如连接/设备详情);返回 1=重绘 */
int live; /* 1=驻留时周期性(约2s)重扫行(蓝牙/附近扫描刷新用) */
void *ctx; /* 页面私有上下文 */
/* ---- 批③ 后台管理页按钮化(可选;NULL/0=按旧路径,未填页/WiFi/蓝牙/锁屏等不受影响)----
* 提供下方任一回调即启用对应渲染/命中定制;全 NULL 时行为与旧版完全一致。 */
const char *top_action; /* 顶栏标题栏右侧动作按钮文案(NULL=无按钮) */
int (*top_action_cb)(void *ctx); /* 点顶栏动作按钮;返回 1=重绘 */
/* 行完全自绘(覆盖默认 renderer;页内由 r->kind 区分行型)。state=MEOW_LISTVIEW_ST_*(选中/按压/禁用)。 */
void (*row_draw)(void *ctx, int idx, sub_row_t *r,
int x, int y, int w, int h, int state);
/* 点 SUB_ROW 行(自定义命中:页内自行区分「行内按钮区 vs 行体」;x,y=tap,rx..rh=行视口矩形);
* 返回 1=重绘。仅 kind==SUB_ROW 且本回调非空时走此路径,否则走 detail。 */
int (*row_tap)(void *ctx, int idx, sub_row_t *r, int x, int y,
int rx, int ry, int rw, int rh);
} sub_page_t;
/* 运行子页(阻塞到返回;返回 0)。由 wifi_page.c / bt_page.c 各自实现。 */