fix(launcher): 图标区空白——menu_draw_icon 垫块+首字母先画、图片叠加(icon透明/解码失败时占位仍可见); 补 sys_mem_available_kb 实现(解锁OOM护栏编译) (agent-218)

launcher 333d6f53→9902f19c; 宿主test_host_icon PASS
This commit is contained in:
MeowOS committed 2026-08-31 14:34:28 +08:00
1 parent 228e9e79e0
commit e8deed88bd
7 files changed
+193 -2

No files matched your search

+7 -2
View File
@@ -385,17 +385,22 @@ static void menu_name_fit(const char *name, int maxw, int size, char *out, int o
snprintf(out, olen, "%s...", buf);
}
/* 图标绘制:有图 meow_ui_img_cover(居中裁方);无图 → 主题色圆角块 + 首字母。 */
/* 图标绘制:primary 圆角垫块始终垫底(MD3 图标 tile),首字母叠加其上,最后有图叠加
* meow_ui_img_cover(居中裁方)。
* 修复:原实现 `if (icon) { meow_ui_img_cover; return; }` 在图标为透明背景 logo(不透明像素
* 极少/无)时整区只剩卡面,且因 icon!=NULL 完全跳过占位 →「图标区+首字母占位都不见了」。
* 现让垫块+首字母先画:不透明/方图盖住它们(观感=纯图);透明图则露出垫块+首字母(占位)。
* 图标区任何情况下都非空,且首字母占位不再被图标句柄吞掉。 */
static void menu_draw_icon(const struct app *a, meow_img *icon, int x, int y, int sz,
const meow_ui_theme_t *th)
{
if (icon) { meow_ui_img_cover(x, y, sz, icon); return; }
meow_gfx_fill_round(x, y, sz, sz, sz * 3 / 10, th->primary);
char g[4];
menu_first_glyph(a->name, g);
uint32_t fg = menu_contrast(th->primary);
int cw = ui_width(g, 20);
ui_draw(x + sz / 2 - cw / 2, y + sz / 2 - meow_font_line_height(20) / 2, g, fg, 20);
if (icon) { meow_ui_img_cover(x, y, sz, icon); }
}
/* 应用格几何(grid/list 统一入口;供 draw 与 touch 命中共用)。 */