feat(ncm): 复古UI重做 (agent-211, 按 NCM_UI_DESIGN.md) — 白红/黑红双套配色(ncm_palette+主题监听实时换肤); 主页红topbar+个人区+双页签(我创建的/我收藏的, is_collected/subscribed已补); 搜索页(cloudsearch,仅确认时发请求); 歌单详情封面头块+播放全部; 播放页黑胶唱盘(行扫圆+封面裁圆+唱针+分带刷新); 播放页tick分带刷新修整页重绘隐患
ncm→90a25cf0; 0 warning; 宿主14张双主题截图目检+core测试全过
This commit is contained in:
1 parent
4cec476dd9
commit
8964cd1750
33 files changed
+1333
-320
No files matched your search
@@ -34,37 +34,44 @@ static void settings_draw(void *ctx)
|
||||
(void)ctx;
|
||||
if (meow_ui_activity_active() != ACT_SETTINGS) return;
|
||||
const meow_theme *th = meow_theme_get();
|
||||
const ncm_pal_t *pa = ncm_palette(g_dark);
|
||||
g_row_h = 60;
|
||||
int y = r_cont.y + 16;
|
||||
int w = r_cont.w - 2 * APP_PAD;
|
||||
int x = APP_PAD;
|
||||
|
||||
/* 行:音质 / 缓存上限 / 退出登录 */
|
||||
struct { const char *title; char sub[48]; } rows[3];
|
||||
rows[0].title = "Music Quality";
|
||||
rows[1].title = "Cache Limit";
|
||||
rows[2].title = "Sign Out";
|
||||
snprintf(rows[0].sub, sizeof rows[0].sub, "current: %s", level_name(g_st.level));
|
||||
snprintf(rows[1].sub, sizeof rows[1].sub, "current: %d GB", g_st.cache_limit_gb);
|
||||
snprintf(rows[2].sub, sizeof rows[2].sub, "%s", g_st.nickname[0] ? g_st.nickname : "sign out");
|
||||
/* 行:音质 / 缓存上限 / 退出登录 / 关于(色 = 语义色;退出 = error)。 */
|
||||
struct { const char *title; char sub[160]; int red; } rows[4];
|
||||
rows[0].title = "音质"; rows[0].red = 0;
|
||||
rows[1].title = "缓存上限"; rows[1].red = 0;
|
||||
rows[2].title = "退出登录"; rows[2].red = 1;
|
||||
rows[3].title = "关于网易云"; rows[3].red = 0;
|
||||
snprintf(rows[0].sub, sizeof rows[0].sub, "当前: %s", level_name(g_st.level));
|
||||
snprintf(rows[1].sub, sizeof rows[1].sub, "当前: %d GB", g_st.cache_limit_gb);
|
||||
snprintf(rows[2].sub, sizeof rows[2].sub, "%s", g_st.nickname[0] ? g_st.nickname : "退出");
|
||||
snprintf(rows[3].sub, sizeof rows[3].sub, "%s", "v0.1 · MeowOS");
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
int yy = y + i * (g_row_h + 8);
|
||||
meow_ui_fill_rect(x, yy, w, g_row_h, th->surfaceContainer);
|
||||
uint32_t tcol = (i == 2) ? th->error : th->fg;
|
||||
uint32_t scol = (i == 2) ? th->error : th->dim;
|
||||
ncm_fill_round(x, yy, w, g_row_h, 12, th->surfaceContainer);
|
||||
uint32_t tcol = rows[i].red ? th->error : th->onSurface;
|
||||
uint32_t scol = rows[i].red ? th->error : th->onSurfaceVariant;
|
||||
meow_ui_text(x + APP_PAD, yy + 12, rows[i].title, 20, tcol);
|
||||
meow_ui_text(x + APP_PAD, yy + 34, rows[i].sub, 20, scol);
|
||||
/* 右侧箭头 (draw) */
|
||||
meow_ui_text_right(x + w - APP_PAD, yy + 18, ">", 28, th->dim);
|
||||
meow_ui_text_right(x + w - APP_PAD, yy + 18, ">", 28, rows[i].red ? th->error : th->onSurfaceVariant);
|
||||
}
|
||||
|
||||
/* 分组说明(占位)+ 品牌红小字。 */
|
||||
int ny = y + 4 * (g_row_h + 8) + 4;
|
||||
meow_ui_text(x, ny, "以下为占位,v1 不启用", 20, th->onSurfaceVariant);
|
||||
meow_ui_text(x, ny + 24, "品牌红 © MeowOS · NCM", 20, pa->red);
|
||||
}
|
||||
|
||||
static int row_at(int x, int y)
|
||||
{
|
||||
(void)x;
|
||||
int r = r_cont.y + 16;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
int yy = r + i * (g_row_h + 8);
|
||||
if (y >= yy && y <= yy + g_row_h) return i;
|
||||
}
|
||||
@@ -128,6 +135,10 @@ int settings_on_tap(int x, int y)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (row == 3) { /* 关于(v1 占位) */
|
||||
ncm_snack("关于页开发中");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user