From 491db5069c9ffd897fba8da90462c45eb97e2cd4 Mon Sep 17 00:00:00 2001 From: AskaEth Date: Fri, 4 Sep 2026 03:51:30 +0800 Subject: [PATCH] =?UTF-8?q?style(launcher):=20=E4=B8=BB=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E9=A1=B6=E6=A0=8F'=E5=90=8E=E5=8F=B0'=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=BE=8E=E5=8C=96=20=E2=80=94=20=E5=8E=BB?= =?UTF-8?q?=E6=96=B9=E5=BD=A2primary=E5=BA=95=E6=94=B9surface=5Fcontainer?= =?UTF-8?q?=E6=9F=94=E5=92=8C=E5=9C=86=E8=A7=92+=E7=9F=A2=E9=87=8F?= =?UTF-8?q?=E5=8F=8C=E5=8D=A1=E5=B1=82=E5=8F=A0=E5=9B=BE=E6=A0=87(?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=BA=94=E7=94=A8=E5=A0=86=E5=8F=A0=E8=AF=AD?= =?UTF-8?q?=E4=B9=89)+=E5=B0=8F=E5=AD=97'=E5=90=8E=E5=8F=B0';=E5=91=BD?= =?UTF-8?q?=E4=B8=AD=E7=9F=A9=E5=BD=A2/=E5=85=A5=E5=8F=A3=E4=B8=8D?= =?UTF-8?q?=E5=8F=98,0warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patch_v2/meow_launcherd/main_menu.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/patch_v2/meow_launcherd/main_menu.c b/patch_v2/meow_launcherd/main_menu.c index 436e771..40beaaf 100644 --- a/patch_v2/meow_launcherd/main_menu.c +++ b/patch_v2/meow_launcherd/main_menu.c @@ -96,18 +96,24 @@ static void menu_after_app_exit(int app_ran) static int menu_title_size(void); /* 前向声明:draw_header_content 用(定义在下方布局帮助块) */ static uint32_t menu_contrast(uint32_t c); /* 前向声明(定义在下方布局帮助块) */ -/* 批③:桌面顶栏居右「后台管理」按钮(图标 tile + 字块)。命中区见 BGMR_BTN_*。 */ +/* 批③:桌面顶栏居右「后台管理」按钮(柔和圆角底 + 层叠卡片图标 + 小字,替下原先整块 + * primary 方块)。命中区见 BGMR_BTN_*(不变)。 */ #define BGMR_BTN_S 46 /* 按钮边长 */ #define BGMR_BTN_X0 (fb_xres - BGMR_BTN_S - 14) /* 右缘留 14px 边距 */ #define BGMR_BTN_Y0 40 /* 顶缘(标题行内,apps 区之上) */ static void menu_draw_bgm_btn(const meow_ui_theme_t *th) { int x = BGMR_BTN_X0, y = BGMR_BTN_Y0, s = BGMR_BTN_S; - fill_rect(x, y, s, s, th->primary); + /* 柔和圆角底(surface_container 卡片语义),与主界面卡片/容器视觉统一 */ + meow_gfx_fill_round(x, y, s, s, 12, th->surface_container); + /* 层叠卡片图标 = 后台/应用栈:后卡 muted、前卡 primary(前卡后画盖住后卡中部) */ + int cx = x + s / 2; + meow_gfx_fill_round(cx - 13, y + 13, 18, 12, 4, th->on_surface_variant); /* 后卡 */ + meow_gfx_fill_round(cx - 5, y + 6, 18, 12, 4, th->primary); /* 前卡 */ + /* 小字标签(on_surface,落在 surface_container 底上对比足够) */ const char *lab = meow_str_zh("bgmgr.topbtn", "后台"); int tw = meow_ui_text_width(lab, 14); - ui_draw(x + (s - tw) / 2, y + (s - meow_font_line_height(14)) / 2, lab, - menu_contrast(th->primary), 14); + ui_draw(cx - tw / 2, y + 27, lab, th->on_surface, 14); } static int menu_hit_bgm_btn(int tx, int ty) { @@ -187,6 +193,13 @@ void s_draw_chevron_left(int x, int y, uint32_t color) #define MENU_LIST_ROW_H 60 /* 列表行高(大图标行) */ #define MENU_LIST_ICON 40 /* 列表图标 ink 高(方) */ #define MENU_LIST_ICON_X 24 /* 列表图标左缘 */ +/* 圆角卡列表项外边距(item margin/gap):相邻卡片间可见空隙 px。SDK listview 行距(=MENU_LIST_ROW_H) + * 不变——卡片在其行高内上下对称内缩 MENU_LIST_ROW_GAP/2,故内容(按行高垂直居中)仍落卡中心; + * 相邻卡顶间距恒=MENU_LIST_ROW_H=卡高+MENU_LIST_ROW_GAP。要求偶数,保证上下对称。 */ +#define MENU_LIST_ROW_GAP 8 +/* 第 idx 行(行顶 row_top,行高 h)的圆角卡:顶 y 与高。卡片上下对称内缩,行中心=卡中心。 */ +static inline int menu_row_card_y(int row_top) { return row_top + MENU_LIST_ROW_GAP / 2; } +static inline int menu_row_card_h(int h) { return h - MENU_LIST_ROW_GAP; } /* 应用图标缓存(进主界面加载一次,不每帧解码;index 对齐 apps[]) */ static meow_img *s_app_icons[MAX_APPS]; @@ -619,10 +632,14 @@ static void menu_draw_list_cell(const struct app *a, meow_img *icon, int x, int int w, int h, int sel, int pressed, const meow_ui_theme_t *th) { - meow_gfx_fill_round(x, y, w, h, 12, th->surface_container); + /* 圆角卡在行高内上下对称内缩(card center = 行中心):给相邻圆角卡之间留出可见外距, + * 消除原来「卡高==行距」导致的紧贴。内容仍按整行高垂直居中(行中心=卡中心)。 */ + int cy = menu_row_card_y(y); + int ch = menu_row_card_h(h); + meow_gfx_fill_round(x, cy, w, ch, 12, th->surface_container); if (sel || pressed) { int alpha = pressed ? 72 : 40; - meow_gfx_fill_round_alpha(x, y, w, h, 12, th->primary, alpha); + meow_gfx_fill_round_alpha(x, cy, w, ch, 12, th->primary, alpha); } int sz = MENU_LIST_ICON; int icy = y + (h - sz) / 2;