fix(hello): demo 左滑列表行高按字体行高派生 — 首行标题不再丢失(M17)
根因(承接 M12/M15 finding):SDK meow_listview 双行 renderer 把 block = 2*meow_ui_text_height(font_body) + MEOW_LISTV_SUB_GAP(2) 在行内垂直居中 (ty = 行顶 + (item - block)/2),标题只在 ty >= 视口顶时才画。demo 的 swipe 列表 显式 set_item_renderer(2,1,0)(双行档位)却 set_item_h(48):真机 source_han_serif 20px 行高 30 → block 62 → ty = 行顶 - 7,首行「notif 0」标题被裁剪守卫整条跳过, 只剩 swipe left 副标题。 修复: - hello_internal.h:新增 HELLO_ROW_H_MIN(56) / HELLO_ROW_SUB_GAP(2,与 SDK MEOW_LISTV_SUB_GAP 同口径) + hello_row_h_for_line_h(line_h) = max(56, 2*line_h + 2) + hello_row_h()(取当前主题 font_body 的 meow_ui_text_height)。本地派生,不依赖 M15 新增导出 meow_listview_item_h; 显式传值在 M15 之前的 SDK(默认 48/56 档位)与 M15 之后(默认已派生 62)都成立且一致。 - ui/demo/sdk2/sdk2.c:set_item_h(48) 改传 hello_row_h()(行高 30 → 62)。 列表视口 LV_H / 三节布局推进量不变(行高只影响行内几何与滚动量),其它 demo 区块 (LazyColumn 列表、宫格、选择器)不受影响。 验证(宿主,未碰真机): - zig-mipsel-cc -Os -static -Wall -Wextra(另用 -Werror 复验)交叉编译 hello:0 warning; - 新宿主 test/test_row_text_fit.c(32 断言,纯头文件派生、不链 SDK): 字库行高矩阵 14/21/26/27/30 下 block <= item、首行 ty >= 0;行高 30 → 62; 旧 48 → ty=-7 的 bug 形态哨兵;全 PASS。 影响:meow_ui.a 未改 → 无需重编 SDK;本 App 需重链重部署(热更 hello 二进制)。
This commit is contained in:
1 parent
e69b8efeeb
commit
9600f10352
3 files changed
+113
-1
No files matched your search
@@ -266,7 +266,7 @@ int sdk2_build_at(int yb_base, int ct, int scroll)
|
||||
g_lv = meow_listview_create(r_lv.x, r_lv.y, r_lv.w, r_lv.h, 0,
|
||||
NULL, NULL, MEOW_LIST_SEL_NONE);
|
||||
if (g_lv) {
|
||||
meow_listview_set_item_h(g_lv, 48);
|
||||
meow_listview_set_item_h(g_lv, hello_row_h()); /* M17:双行文本块按字体行高派生 */
|
||||
meow_listview_set_vsource(g_lv, lv_count, lv_bind, NULL);
|
||||
meow_listview_set_item_renderer(g_lv, 2, 1, 0); /* 双行、左图标、无右尾件 */
|
||||
meow_listview_set_empty_text(g_lv, "All rows deleted");
|
||||
|
||||
Reference in new issue
Block a user