fix(ncm): SDK圆角矩形列表项加外边距 — 实为ncm_app应用层自绘(row_bg圆角卡),调用处加NCM_ROW_GAP=8px卡间可见外距(卡高48/行距56上下对称+擦SDK行分隔线);三屏playlist/home/queue;宿主test_meow_row_gap PASS,0warning,不涉meow_ui.a无需重链
This commit is contained in:
1 parent
a82f3f9dfa
commit
e8218b8ae9
5 files changed
+107
-15
No files matched your search
@@ -91,7 +91,8 @@ static void home_row_bg(void *ctx)
|
||||
int n = tab_count(g_tab);
|
||||
if (last > n) last = n;
|
||||
for (int i = first; i < last; i++) {
|
||||
int ry = r_list.y + (i * item - off) + 1, th2 = item - 2;
|
||||
int ry = ncm_row_card_y(item, i, off, r_list.y);
|
||||
int th2 = ncm_row_card_h(item);
|
||||
if (ry < r_list.y || ry + th2 > r_list.y + r_list.h) continue; /* 只画完整落在视口内的行 */
|
||||
ncm_fill_round(r_list.x, ry, r_list.w, th2, 12, th->surfaceContainer);
|
||||
}
|
||||
@@ -170,16 +171,21 @@ static void home_draw(void *ctx)
|
||||
int n = tab_count(g_tab);
|
||||
if (last > n) last = n;
|
||||
for (int i = first; i < last; i++) {
|
||||
int ry = r_list.y + (i * item - off) + 1, th2 = item - 2;
|
||||
int ry = ncm_row_card_y(item, i, off, r_list.y);
|
||||
int th2 = ncm_row_card_h(item);
|
||||
if (ry < r_list.y || ry + th2 > r_list.y + r_list.h) continue;
|
||||
int icy = ry + (item - isz) / 2;
|
||||
int icy = ry + (th2 - isz) / 2;
|
||||
int bx = r_list.x + 16;
|
||||
ncm_fill_round(bx, icy, isz, isz, 6, pa->red);
|
||||
meow_ui_fill_rect(bx + isz / 2 - 2, icy + isz / 2 - 2, 4, 4, pa->on_red); /* 盘芯 */
|
||||
if (g_press_row == i) {
|
||||
meow_ui_fill_rect(r_list.x, ry, 4, item - 2, pa->red);
|
||||
meow_ui_fill_rect_alpha(r_list.x, ry, r_list.w, item - 2, pa->red, 26);
|
||||
meow_ui_fill_rect(r_list.x, ry, 4, th2, pa->red);
|
||||
meow_ui_fill_rect_alpha(r_list.x, ry, r_list.w, th2, pa->red, 26);
|
||||
}
|
||||
/* 擦除 z=10 的 SDK 行分隔线(现落进卡片间空隙):以页底色填空隙带;不越出列表视口底。 */
|
||||
int gy = ry + th2, gh = NCM_ROW_GAP;
|
||||
if (gy + gh > r_list.y + r_list.h) gh = r_list.y + r_list.h - gy;
|
||||
if (gh > 0) meow_ui_fill_rect(r_list.x, gy, r_list.w, gh, th->bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,8 @@ static void pl_row_bg(void *ctx)
|
||||
int first = off / item, last = (off + r_list.h) / item + 1;
|
||||
if (last > g_st.track_ids_count) last = g_st.track_ids_count;
|
||||
for (int i = first; i < last; i++) {
|
||||
int ry = r_list.y + (i * item - off) + 1, th2 = item - 2;
|
||||
int ry = ncm_row_card_y(item, i, off, r_list.y);
|
||||
int th2 = ncm_row_card_h(item);
|
||||
if (ry < r_list.y || ry + th2 > r_list.y + r_list.h) continue; /* 只画完整落在视口内的行 */
|
||||
ncm_fill_round(r_list.x, ry, r_list.w, th2, 12, th->surfaceContainer);
|
||||
}
|
||||
@@ -193,15 +194,20 @@ static void pl_draw(void *ctx)
|
||||
int first = off / item, last = (off + r_list.h) / item + 1;
|
||||
if (last > g_st.track_ids_count) last = g_st.track_ids_count;
|
||||
for (int i = first; i < last; i++) {
|
||||
int ry = r_list.y + (i * item - off) + 1, th2 = item - 2;
|
||||
int ry = ncm_row_card_y(item, i, off, r_list.y);
|
||||
int th2 = ncm_row_card_h(item);
|
||||
if (ry < r_list.y || ry + th2 > r_list.y + r_list.h) continue;
|
||||
int icy = ry + (item - isz) / 2, bx = r_list.x + 16;
|
||||
int icy = ry + (th2 - isz) / 2, bx = r_list.x + 16;
|
||||
ncm_fill_round(bx, icy, isz, isz, 6, pa->red);
|
||||
meow_ui_fill_rect(bx + isz / 2 - 2, icy + isz / 2 - 2, 4, 4, pa->on_red);
|
||||
if (g_press_row == i) {
|
||||
meow_ui_fill_rect(r_list.x, ry, 4, item - 2, pa->red);
|
||||
meow_ui_fill_rect_alpha(r_list.x, ry, r_list.w, item - 2, pa->red, 26);
|
||||
meow_ui_fill_rect(r_list.x, ry, 4, th2, pa->red);
|
||||
meow_ui_fill_rect_alpha(r_list.x, ry, r_list.w, th2, pa->red, 26);
|
||||
}
|
||||
/* 擦除 z=10 的 SDK 行分隔线(现落进卡片间空隙):以页底色填空隙带;不越出列表视口底。 */
|
||||
int gy = ry + th2, gh = NCM_ROW_GAP;
|
||||
if (gy + gh > r_list.y + r_list.h) gh = r_list.y + r_list.h - gy;
|
||||
if (gh > 0) meow_ui_fill_rect(r_list.x, gy, r_list.w, gh, th->bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,8 @@ static void q_row_bg(void *ctx)
|
||||
if (last > cnt) last = cnt;
|
||||
int cur = player_manager_playing_song();
|
||||
for (int i = first; i < last; i++) {
|
||||
int ry = r_list.y + (i * item - off) + 1, th2 = item - 2;
|
||||
int ry = ncm_row_card_y(item, i, off, r_list.y);
|
||||
int th2 = ncm_row_card_h(item);
|
||||
if (ry < r_list.y || ry + th2 > r_list.y + r_list.h) continue; /* 只画完整落在视口内的行 */
|
||||
if (i == cur) {
|
||||
/* 当前播放行:红色左条 + 红色轻染(高亮),底用 red_ctr 浅红 */
|
||||
@@ -112,6 +113,7 @@ static void q_draw(void *ctx)
|
||||
{
|
||||
(void)ctx;
|
||||
if (meow_ui_activity_active() != ACT_QUEUE) return;
|
||||
const meow_theme *th = meow_theme_get();
|
||||
const ncm_pal_t *pa = ncm_palette(g_dark);
|
||||
int cnt = appstate_queue_count();
|
||||
if (cnt <= 0) return;
|
||||
@@ -120,15 +122,20 @@ static void q_draw(void *ctx)
|
||||
int first = off / item, last = (off + r_list.h) / item + 1;
|
||||
if (last > cnt) last = cnt;
|
||||
for (int i = first; i < last; i++) {
|
||||
int ry = r_list.y + (i * item - off) + 1, th2 = item - 2;
|
||||
int ry = ncm_row_card_y(item, i, off, r_list.y);
|
||||
int th2 = ncm_row_card_h(item);
|
||||
if (ry < r_list.y || ry + th2 > r_list.y + r_list.h) continue;
|
||||
int icy = ry + (item - isz) / 2, bx = r_list.x + 16;
|
||||
int icy = ry + (th2 - isz) / 2, bx = r_list.x + 16;
|
||||
ncm_fill_round(bx, icy, isz, isz, 6, pa->red);
|
||||
meow_ui_fill_rect(bx + isz / 2 - 2, icy + isz / 2 - 2, 4, 4, pa->on_red);
|
||||
if (g_press_row == i) {
|
||||
meow_ui_fill_rect(r_list.x, ry, 4, item - 2, pa->red);
|
||||
meow_ui_fill_rect_alpha(r_list.x, ry, r_list.w, item - 2, pa->red, 26);
|
||||
meow_ui_fill_rect(r_list.x, ry, 4, th2, pa->red);
|
||||
meow_ui_fill_rect_alpha(r_list.x, ry, r_list.w, th2, pa->red, 26);
|
||||
}
|
||||
/* 擦除 z=10 的 SDK 行分隔线(现落进卡片间空隙):以页底色填空隙带;不越出列表视口底。 */
|
||||
int gy = ry + th2, gh = NCM_ROW_GAP;
|
||||
if (gy + gh > r_list.y + r_list.h) gh = r_list.y + r_list.h - gy;
|
||||
if (gh > 0) meow_ui_fill_rect(r_list.x, gy, r_list.w, gh, th->bg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user