feat(sdk): 结构化列表控件 W_LISTVIEW (agent-186) — MEOW_APP_SDK §5.5 A②落地: 图标(内置folder/file符号或img)+标题+副标题+右侧操作(arrow/switch/check/more), 单选/多选/禁态, 行右1/3操作区命中, 视口裁剪, 全语义色; meow_ui_img_scaled 弱引用防二进制膨胀; files App 自绘列表完整迁移(长按留App层)
meow_ui.a ece0ecdb→4335c33a; hello 07b1ee37→07c0c5a5; files 6f6b0a6d→22b6b606 宿主: widgets(含4条listview新断言)/p1p2p3/ime_fix/test_fsx 全 PASS
This commit is contained in:
1 parent
3f57d7fd4f
commit
243148e440
8 files changed
+667
-155
No files matched your search
@@ -14,7 +14,8 @@ enum { W_BTN = 0, W_SLIDER = 1, W_SWITCH = 2, W_LIST = 3,
|
||||
W_CUSTOM = 4, W_LAYOUT = 5, W_SPACER = 6,
|
||||
W_TEXTFIELD = 7, W_CARD = 8, W_DIVIDER = 9, W_BADGE = 10,
|
||||
W_CHECKBOX = 11, W_RADIO = 12, W_PROGRESS = 13,
|
||||
W_TOPAPPBAR = 14, W_NAVBAR = 15, W_TABBAR = 16, W_FAB = 17 };
|
||||
W_TOPAPPBAR = 14, W_NAVBAR = 15, W_TABBAR = 16, W_FAB = 17,
|
||||
W_LISTVIEW = 18 }; /* §5.5 结构化列表(行=图标+标题+副标题+右侧操作+选中) */
|
||||
|
||||
/* 布局子项数组上限(固定尺寸子项先做;超出静默拒收)。 */
|
||||
#define MEOW_LAYOUT_MAX_CHILD 32
|
||||
@@ -81,6 +82,14 @@ struct meow_widget {
|
||||
/* M2.71-bug8:W_LIST 行点击回调(可选)。 */
|
||||
meow_list_tap_fn tap_cb; /* 命中行回调(可 NULL) */
|
||||
void *tap_ctx; /* 回调 ctx */
|
||||
|
||||
/* §5.5 结构化列表(W_LISTVIEW):行=图标+标题+副标题+右侧操作+选中(calloc 归零,安全) */
|
||||
meow_list2_source src2; /* 行数据源(meow_list_item) */
|
||||
int sel_mode; /* MEOW_LIST_SEL_* */
|
||||
uint32_t *sel_bits; /* 多选位图(sel_bits_n 个字;SINGLE 不分配) */
|
||||
int sel_bits_n; /* 位图字数 */
|
||||
meow_listview_tap_fn lv_tap_cb; /* 行点击回调(idx, op) */
|
||||
void *lv_tap_ctx; /* 回调 ctx */
|
||||
};
|
||||
|
||||
/* ---- §5.8 batch1 内部辅助:opts 取值(opts_used==0 时按控件内建默认)----
|
||||
@@ -328,6 +337,7 @@ void meow_widget_free(meow_widget *w)
|
||||
if (!w) return;
|
||||
meow_draw_widget_unregister(w); /* §6.2:绘制物注册表自动注销(stale id 失效勿用) */
|
||||
live_btn_unregister(w);
|
||||
if (w->sel_bits) { free(w->sel_bits); w->sel_bits = NULL; } /* W_LISTVIEW 多选位图 */
|
||||
free(w);
|
||||
}
|
||||
|
||||
@@ -881,6 +891,271 @@ int meow_list_tap_at(meow_widget *w, int x, int y)
|
||||
return idx;
|
||||
}
|
||||
|
||||
/* ============================================================ */
|
||||
/* §5.5 结构化列表(W_LISTVIEW):行=图标+标题+副标题+右侧操作+选中
|
||||
* ------------------------------------------------------------
|
||||
* 行数据源(meow_list2_source)逐行填充 meow_list_item;容器只画可见行(虚拟化)+ 视口裁剪
|
||||
* (M2.73 纪律:只画视口内行/分隔线/文本,无标题栏/底部泄漏);局部 dirty;行高固定;首/末行
|
||||
* 钳制。颜色全部取 meow_theme_get() 语义色(日/夜/style 自动),禁止硬编码。 */
|
||||
/* ============================================================ */
|
||||
#define MEOW_LISTV_ICON 24 /* 图标盒尺寸(px) */
|
||||
#define MEOW_LISTV_PAD 16 /* 行内左右 padding(px) */
|
||||
#define MEOW_LISTV_SUB_GAP 2 /* 标题与副标题间隙(px) */
|
||||
|
||||
/* meow_ui_img_scaled 弱引用:W_LISTVIEW 的 MEOW_LIST_ICON_IMG 分支用它绘制图片图标。
|
||||
* 弱引用让「只用内置符号图标、不解码图片」的 App 不被牵连进 meow_ui_img.o/stb_image.o
|
||||
* (静态库惰性链接:无强引用则不拉入 stb 解码器,避免所有 App 无谓膨胀 ~77KB)。
|
||||
* 宿主/设备需图片图标的 App 经 meow_ui_img_load_* 强引用 meow_ui_img.o → 此处自动解析。 */
|
||||
extern void meow_ui_img_scaled(int x, int y, int w, int h, meow_img *img) __attribute__((weak));
|
||||
|
||||
static int listv_item_h(const meow_widget *w) { return (w->item_h > 0) ? w->item_h : 56; }
|
||||
|
||||
/* 文本截断:超出 maxw 加 "..."(复用 browser_text_trunc 的逐字符宽度累加)。 */
|
||||
static void listv_text_trunc(int x, int y, const char *s, int maxw, int size, uint32_t col)
|
||||
{
|
||||
if (!s) return;
|
||||
int full = meow_ui_text_width(s, size);
|
||||
if (full <= maxw) { meow_ui_text(x, y, s, size, col); return; }
|
||||
const char *dots = "...";
|
||||
int dw = meow_ui_text_width(dots, size);
|
||||
char tmp[128];
|
||||
int i;
|
||||
for (i = 0; s[i] && i < (int)sizeof tmp - 4; i++) {
|
||||
tmp[i] = s[i];
|
||||
tmp[i + 1] = '\0';
|
||||
if (meow_ui_text_width(tmp, size) > maxw - dw) break;
|
||||
}
|
||||
memcpy(tmp + i, dots, 4);
|
||||
meow_ui_text(x, y, tmp, size, col);
|
||||
}
|
||||
|
||||
/* 行图标绘制(内置符号 / meow_img)。col=图标前景(选中/未选中由调用方定)。 */
|
||||
static void listv_draw_icon(const meow_theme *th, int x, int y, int kind,
|
||||
const meow_img *img, uint32_t col)
|
||||
{
|
||||
(void)th;
|
||||
int s = MEOW_LISTV_ICON;
|
||||
if (kind == MEOW_LIST_ICON_IMG && img && meow_ui_img_scaled) { /* 弱符号非空才画(未链 stb 则跳过) */
|
||||
meow_ui_img_scaled(x, y, s, s, (meow_img *)img); /* img 为 opaque 句柄,const 丢弃 */
|
||||
return;
|
||||
}
|
||||
if (kind == MEOW_LIST_ICON_FOLDER) {
|
||||
meow_ui_fill_rect(x, y + 6, s, s - 6, col); /* 主体 */
|
||||
meow_ui_fill_rect(x, y + 2, 12, 6, col); /* 页签 */
|
||||
} else if (kind == MEOW_LIST_ICON_FILE) {
|
||||
meow_ui_draw_rect(x + 4, y + 2, s - 8, s - 4, col);/* 页体 */
|
||||
meow_ui_fill_rect(x + 4, y + 2, 7, 4, col); /* 文件名横条 */
|
||||
}
|
||||
}
|
||||
|
||||
/* 行右侧操作区绘制(箭头/开关/复选/⋯)。x=动作槽左缘;col=前景。 */
|
||||
static void listv_draw_right(const meow_theme *th, int x, int y, int row_h,
|
||||
int right, int on, uint32_t col)
|
||||
{
|
||||
switch (right) {
|
||||
case MEOW_LIST_RIGHT_ARROW: {
|
||||
int cx = x + 4, cy = y + row_h / 2;
|
||||
meow_gfx_line(cx - 4, cy - 6, cx + 4, cy, 2, col);
|
||||
meow_gfx_line(cx + 4, cy, cx - 4, cy + 6, 2, col);
|
||||
break;
|
||||
}
|
||||
case MEOW_LIST_RIGHT_SWITCH: {
|
||||
int sw = 36, sh = 20;
|
||||
int sx = x, sy = y + (row_h - sh) / 2;
|
||||
meow_gfx_fill_round(sx, sy, sw, sh, sh / 2, on ? th->primary : th->onSurfaceVariant);
|
||||
int kr = sh / 2 - 3;
|
||||
int kx = on ? sx + sw - kr * 2 - 3 : sx + 3;
|
||||
meow_gfx_fill_round(kx, sy + 3, kr * 2, kr * 2, kr, on ? th->onPrimary : th->surface);
|
||||
break;
|
||||
}
|
||||
case MEOW_LIST_RIGHT_CHECK: {
|
||||
int cx = x + 2, cy = y + row_h / 2;
|
||||
meow_gfx_line(cx - 6, cy + 2, cx - 1, cy + 7, 2, col);
|
||||
meow_gfx_line(cx - 1, cy + 7, cx + 7, cy - 6, 2, col);
|
||||
break;
|
||||
}
|
||||
case MEOW_LIST_RIGHT_MORE: {
|
||||
int cx = x;
|
||||
int cy0 = y + row_h / 2 - 8;
|
||||
for (int d = 0; d < 3; d++)
|
||||
meow_ui_fill_rect(cx, cy0 + d * 6, 4, 4, col);
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
/* 多选位图扩容(MULTI 且 idx 超出当前容量时;SINGLE 不分配)。 */
|
||||
static void listv_bitmap_grow(meow_widget *w, int idx)
|
||||
{
|
||||
int need = (idx + 1 + 31) / 32;
|
||||
if (need <= w->sel_bits_n) return;
|
||||
uint32_t *nb = (uint32_t *)calloc((size_t)need, sizeof(uint32_t));
|
||||
if (!nb) return;
|
||||
if (w->sel_bits && w->sel_bits_n)
|
||||
memcpy(nb, w->sel_bits, (size_t)w->sel_bits_n * sizeof(uint32_t));
|
||||
free(w->sel_bits);
|
||||
w->sel_bits = nb;
|
||||
w->sel_bits_n = need;
|
||||
}
|
||||
|
||||
meow_widget *meow_listview_create(int x, int y, int w, int h, int count,
|
||||
meow_list2_source src, void *ctx, meow_list_sel mode)
|
||||
{
|
||||
meow_widget *t = (meow_widget *)calloc(1, sizeof *t);
|
||||
if (!t) return NULL;
|
||||
t->type = W_LISTVIEW; t->x = x; t->y = y; t->w = w; t->h = h;
|
||||
t->owner = meow_ui_activity_active();
|
||||
t->state = MEOW_WS_ENABLED;
|
||||
t->count = count > 0 ? count : 0; t->src2 = src; t->ctx = ctx;
|
||||
t->sel = -1; t->item_h = 56; t->scroll = 0;
|
||||
t->sel_mode = (mode >= MEOW_LIST_SEL_NONE && mode <= MEOW_LIST_SEL_MULTI) ? mode : MEOW_LIST_SEL_NONE;
|
||||
if (t->sel_mode == MEOW_LIST_SEL_MULTI && t->count > 0) {
|
||||
t->sel_bits_n = (t->count + 31) / 32;
|
||||
t->sel_bits = (uint32_t *)calloc((size_t)t->sel_bits_n, sizeof(uint32_t));
|
||||
}
|
||||
meow_draw_widget_register(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
int meow_listview_set_item_h(meow_widget *w, int item)
|
||||
{
|
||||
if (!w || w->type != W_LISTVIEW) return -1;
|
||||
if (item > 0) { w->item_h = item; meow_gfx_mark_dirty(w->x, w->y, w->w, w->h); }
|
||||
return w->item_h;
|
||||
}
|
||||
void meow_listview_set_count(meow_widget *w, int count)
|
||||
{
|
||||
if (!w || w->type != W_LISTVIEW) return;
|
||||
if (count < 0) count = 0;
|
||||
if (count == w->count) return;
|
||||
w->count = count;
|
||||
if (w->sel >= w->count) w->sel = -1;
|
||||
if (w->sel_mode == MEOW_LIST_SEL_MULTI) { /* 重分配多选位图 */
|
||||
free(w->sel_bits); w->sel_bits = NULL; w->sel_bits_n = 0;
|
||||
int need = (count + 31) / 32;
|
||||
if (need > 0) {
|
||||
w->sel_bits_n = need;
|
||||
w->sel_bits = (uint32_t *)calloc((size_t)need, sizeof(uint32_t));
|
||||
}
|
||||
}
|
||||
int ms = meow_listview_max_scroll(w); /* 行数减少时 clamp scroll */
|
||||
if (w->scroll > ms) w->scroll = ms;
|
||||
meow_gfx_mark_dirty(w->x, w->y, w->w, w->h);
|
||||
}
|
||||
|
||||
int meow_listview_max_scroll(meow_widget *w)
|
||||
{
|
||||
if (!w || w->type != W_LISTVIEW) return 0;
|
||||
int ms = w->count * listv_item_h(w) - w->h;
|
||||
return ms < 0 ? 0 : ms;
|
||||
}
|
||||
|
||||
void meow_listview_set_scroll(meow_widget *w, int offset)
|
||||
{
|
||||
if (!w || w->type != W_LISTVIEW) return;
|
||||
int ms = meow_listview_max_scroll(w);
|
||||
if (offset < 0) offset = 0;
|
||||
if (offset > ms) offset = ms;
|
||||
if (offset == w->scroll) return;
|
||||
w->scroll = offset;
|
||||
meow_gfx_mark_dirty(w->x, w->y, w->w, w->h);
|
||||
}
|
||||
void meow_listview_scroll_by(meow_widget *w, int dy) { if (w) meow_listview_set_scroll(w, w->scroll + dy); }
|
||||
int meow_listview_scroll(meow_widget *w) { return (w && w->type == W_LISTVIEW) ? w->scroll : 0; }
|
||||
|
||||
void meow_listview_set_sel(meow_widget *w, int idx)
|
||||
{
|
||||
if (!w || w->type != W_LISTVIEW) return;
|
||||
if (w->sel_mode == MEOW_LIST_SEL_NONE) return;
|
||||
if (w->count <= 0) { w->sel = -1; return; }
|
||||
if (idx >= w->count) idx = w->count - 1; /* 越界 clamp(§5.5 首/末行钳制) */
|
||||
if (w->sel_mode == MEOW_LIST_SEL_SINGLE) {
|
||||
if (idx == w->sel) return;
|
||||
w->sel = idx; /* idx<0 = 清除 */
|
||||
meow_gfx_mark_dirty(w->x, w->y, w->w, w->h);
|
||||
} else { /* MULTI:翻转 idx */
|
||||
if (idx < 0) {
|
||||
if (w->sel_bits) memset(w->sel_bits, 0, (size_t)w->sel_bits_n * sizeof(uint32_t));
|
||||
meow_gfx_mark_dirty(w->x, w->y, w->w, w->h);
|
||||
return;
|
||||
}
|
||||
listv_bitmap_grow(w, idx);
|
||||
if (!w->sel_bits) return;
|
||||
w->sel_bits[idx >> 5] ^= (1u << (idx & 31));
|
||||
meow_gfx_mark_dirty(w->x, w->y, w->w, w->h);
|
||||
}
|
||||
}
|
||||
int meow_listview_get_sel(meow_widget *w, int *out, int max)
|
||||
{
|
||||
if (!w || w->type != W_LISTVIEW) return 0;
|
||||
if (!out || max <= 0) return 0;
|
||||
int n = 0;
|
||||
if (w->sel_mode == MEOW_LIST_SEL_MULTI) {
|
||||
for (int i = 0; i < w->count && n < max; i++)
|
||||
if (w->sel_bits && (w->sel_bits[i >> 5] & (1u << (i & 31)))) out[n++] = i;
|
||||
} else if (w->sel >= 0 && n < max) {
|
||||
out[n++] = w->sel;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
int meow_listview_sel_count(meow_widget *w)
|
||||
{
|
||||
if (!w || w->type != W_LISTVIEW) return 0;
|
||||
if (w->sel_mode == MEOW_LIST_SEL_MULTI) {
|
||||
int n = 0;
|
||||
for (int i = 0; i < w->count; i++)
|
||||
if (w->sel_bits && (w->sel_bits[i >> 5] & (1u << (i & 31)))) n++;
|
||||
return n;
|
||||
}
|
||||
return (w->sel >= 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
/* 命中:返回行号(含滚动换算;禁用行/越界 -1)。抬手用最新坐标(goodix 免疫,调用方传抬手落点)。 */
|
||||
int meow_listview_hit(meow_widget *w, int x, int y)
|
||||
{
|
||||
if (!w || w->type != W_LISTVIEW) return -1;
|
||||
if (x < w->x || x >= w->x + w->w || y < w->y || y >= w->y + w->h) return -1;
|
||||
int item = listv_item_h(w);
|
||||
int idx = (y - w->y + w->scroll) / item;
|
||||
if (idx < 0 || idx >= w->count) return -1;
|
||||
if (w->src2) { /* 禁用行不响应(§5.5) */
|
||||
meow_list_item it;
|
||||
memset(&it, 0, sizeof it);
|
||||
if (!w->src2(idx, &it, w->ctx)) return -1;
|
||||
if (!it.enabled) return -1;
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
int meow_listview_hit_op(meow_widget *w, int x, int y)
|
||||
{
|
||||
int idx = meow_listview_hit(w, x, y);
|
||||
if (idx < 0) return 0;
|
||||
int opx = w->x + (w->w * 2 / 3); /* 行右 1/3 = 操作区(§5.5) */
|
||||
if (x < opx) return 0;
|
||||
if (w->src2) {
|
||||
meow_list_item it;
|
||||
memset(&it, 0, sizeof it);
|
||||
if (!w->src2(idx, &it, w->ctx)) return 0;
|
||||
if (it.right == MEOW_LIST_RIGHT_NONE) return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
void meow_listview_set_on_tap(meow_widget *w, meow_listview_tap_fn cb, void *ctx)
|
||||
{
|
||||
if (!w || w->type != W_LISTVIEW) return;
|
||||
w->lv_tap_cb = cb; w->lv_tap_ctx = ctx;
|
||||
}
|
||||
int meow_listview_tap_at(meow_widget *w, int x, int y)
|
||||
{
|
||||
int idx = meow_listview_hit(w, x, y);
|
||||
if (idx < 0) return -1;
|
||||
int op = meow_listview_hit_op(w, x, y);
|
||||
meow_listview_set_sel(w, idx);
|
||||
if (w->lv_tap_cb) w->lv_tap_cb(idx, op, w->lv_tap_ctx);
|
||||
return idx;
|
||||
}
|
||||
|
||||
static int hit(meow_widget *w, int x, int y)
|
||||
{
|
||||
if (!w) return 0;
|
||||
@@ -1071,6 +1346,84 @@ void meow_widget_draw(meow_widget *w)
|
||||
if (disabled) meow_ui_fill_rect_alpha(w->x, w->y, w->w, w->h, th->onSurface, 90);
|
||||
break;
|
||||
}
|
||||
case W_LISTVIEW: {
|
||||
/* §5.5 结构化列表(纵向 LazyColumn):只画可见行(虚拟化)+ 视口裁剪(M2.73 纪律)。
|
||||
* 行 = 图标(左) + 标题 + 副标题(次要色) + 右侧操作区;选中行 = primaryContainer /
|
||||
* onPrimaryContainer(§5.8.3);禁用行变淡不响应(命中由 hit 层保证)。全语义色。 */
|
||||
int item = listv_item_h(w);
|
||||
int vp = w->h; /* 纵向 */
|
||||
int off = w->scroll;
|
||||
int maxs = w->count * item - vp;
|
||||
if (maxs < 0) maxs = 0;
|
||||
if (off < 0) off = 0;
|
||||
if (off > maxs) off = maxs;
|
||||
int first = (item > 0) ? off / item : 0;
|
||||
int last = (item > 0) ? (off + vp) / item + 1 : 0;
|
||||
if (first < 0) first = 0;
|
||||
if (last > w->count) last = w->count;
|
||||
int vx0 = w->x, vy0 = w->y, vy1 = w->y + w->h;
|
||||
int thh = meow_ui_text_height(th->font_body);
|
||||
int pad = MEOW_LISTV_PAD, isz = MEOW_LISTV_ICON;
|
||||
int text_x = vx0 + pad + isz + pad;
|
||||
int op_start = vx0 + (w->w * 2 / 3); /* 行右 1/3 = 操作区(§5.5 命中) */
|
||||
int text_maxw = op_start - pad - text_x; /* 标题/副标题可用宽(不压操作区) */
|
||||
if (text_maxw < 8) text_maxw = 8;
|
||||
for (int i = first; i < last; i++) {
|
||||
meow_list_item it;
|
||||
memset(&it, 0, sizeof it);
|
||||
if (!w->src2 || !w->src2(i, &it, w->ctx)) continue;
|
||||
int ry = w->y + (i * item - off);
|
||||
if (ry >= vy1) break;
|
||||
if (ry + item <= vy0) continue;
|
||||
int cl = ry > vy0 ? ry : vy0; /* 可见顶界(裁剪用) */
|
||||
int cr = (ry + item) < vy1 ? (ry + item) : vy1; /* 可见底界 */
|
||||
int sel = (i == w->sel);
|
||||
uint32_t textcol = sel ? th->onPrimaryContainer : th->onSurface;
|
||||
uint32_t subcol = sel ? th->onPrimaryContainer : th->onSurfaceVariant;
|
||||
if (sel) meow_ui_fill_rect(vx0, cl, w->w, cr - cl, th->primaryContainer);
|
||||
|
||||
/* 图标(左) */
|
||||
uint32_t iccol = sel ? th->onPrimaryContainer
|
||||
: ((it.icon_kind == MEOW_LIST_ICON_FOLDER) ? th->primary
|
||||
: th->onSurfaceVariant);
|
||||
int icy = ry + (item - isz) / 2;
|
||||
if (icy + isz >= vy0 && icy < vy1) /* 图标不越视口边界才画(防泄漏) */
|
||||
listv_draw_icon(th, vx0 + pad, icy, it.icon_kind, it.icon, iccol);
|
||||
|
||||
/* 标题 + 副标题(两行居中;无副标题=单行居中;越界不画防泄漏) */
|
||||
int ty;
|
||||
if (it.subtitle && it.subtitle[0]) {
|
||||
ty = ry + (item - (2 * thh + MEOW_LISTV_SUB_GAP)) / 2;
|
||||
if (it.title && ty >= vy0 && ty + thh <= vy1)
|
||||
listv_text_trunc(text_x, ty, it.title, text_maxw, th->font_body, textcol);
|
||||
int sy = ty + thh + MEOW_LISTV_SUB_GAP;
|
||||
if (sy >= vy0 && sy + thh <= vy1)
|
||||
listv_text_trunc(text_x, sy, it.subtitle, text_maxw, th->font_body, subcol);
|
||||
} else {
|
||||
ty = ry + (item - thh) / 2;
|
||||
if (it.title && ty >= vy0 && ty + thh <= vy1)
|
||||
listv_text_trunc(text_x, ty, it.title, text_maxw, th->font_body, textcol);
|
||||
}
|
||||
|
||||
/* 右侧操作区 */
|
||||
if (it.right != MEOW_LIST_RIGHT_NONE) {
|
||||
int ax = w->x + w->w - pad - 24; /* 右缘动作槽(约 24px) */
|
||||
if (ax >= op_start)
|
||||
listv_draw_right(th, ax, ry, item, it.right, it.on, subcol);
|
||||
}
|
||||
|
||||
/* 分隔线(仅落在可见带内才画) */
|
||||
int sy = ry + item - 1;
|
||||
if (sy >= cl && sy < cr)
|
||||
meow_ui_fill_rect(vx0, sy, w->w, 1, th->outlineVariant);
|
||||
|
||||
/* 禁用行整体变淡(§5.5/§5.8.3 enabled=0 → 变暗) */
|
||||
if (!it.enabled)
|
||||
meow_ui_fill_rect_alpha(vx0, cl, w->w, cr - cl, th->onSurface, 90);
|
||||
}
|
||||
if (disabled) meow_ui_fill_rect_alpha(w->x, w->y, w->w, w->h, th->onSurface, 90);
|
||||
break;
|
||||
}
|
||||
case W_CUSTOM:
|
||||
/* SDK 不替自定义画布画背景/状态层;App 在 render_cb 里自绘(th 供取色),
|
||||
* 可读 meow_widget_state(状态位)/ meow_widget_opts_get(通用修饰)自行叠。 */
|
||||
|
||||
Reference in new issue
Block a user