chore(release): v0.1.4 - 1:1 SyncLyrics, scroll isolation, object-fit cover, Concerts icon, friends' likes & duplicate-title albums
This commit is contained in:
parent
0b2561503f
commit
f063382410
21 changed files with 1287 additions and 288 deletions
|
|
@ -352,7 +352,7 @@ pub fn render_collection(
|
|||
cx += card_w + gap;
|
||||
}
|
||||
|
||||
for pl in playlists.iter().take(24) {
|
||||
for (idx, pl) in playlists.iter().take(60).enumerate() {
|
||||
let cr = Rect::from_xywh(cx, y, card_w, card_h);
|
||||
if cr.right() >= row_vp.left() - 24.0 && cr.left() <= row_vp.right() + 24.0 {
|
||||
let sub = t.count_tracks(pl.track_count as usize);
|
||||
|
|
@ -363,14 +363,17 @@ pub fn render_collection(
|
|||
ctx,
|
||||
pal,
|
||||
covers,
|
||||
WidgetId::from_pair("col_ov_pl", format!("{}_{}", pl.owner_uid, pl.kind)),
|
||||
WidgetId::from_pair(
|
||||
"col_ov_pl",
|
||||
(idx, format!("{}_{}", pl.owner_uid, pl.kind)),
|
||||
),
|
||||
cr,
|
||||
&pl.title,
|
||||
&sub,
|
||||
pl.cover_uri.as_deref(),
|
||||
&format!("upl_{}_{}", pl.owner_uid, pl.kind),
|
||||
false,
|
||||
false,
|
||||
pl.kind == "3" && pl.cover_uri.is_none(),
|
||||
);
|
||||
if let Some(pos) = m.right_clicked_pos {
|
||||
shell.open_entity_menu(EntityContextMenuState {
|
||||
|
|
@ -407,7 +410,7 @@ pub fn render_collection(
|
|||
ctx.end_scroll_h(
|
||||
h_id,
|
||||
pal,
|
||||
(playlists.len().min(24) + 1) as f32 * (card_w + gap),
|
||||
(playlists.len().min(60) + 1) as f32 * (card_w + gap),
|
||||
false,
|
||||
);
|
||||
y += card_h + 26.0;
|
||||
|
|
@ -454,9 +457,10 @@ pub fn render_collection(
|
|||
let sx = ctx.begin_scroll_h(h_id, row_vp, 0.0);
|
||||
let mut cx = x - sx;
|
||||
|
||||
for alb in albums.iter().take(24) {
|
||||
for (idx, alb) in albums.iter().take(60).enumerate() {
|
||||
let cr = Rect::from_xywh(cx, y, card_w, card_h);
|
||||
if cr.right() >= row_vp.left() - 24.0 && cr.left() <= row_vp.right() + 24.0 {
|
||||
let alb_title = alb.full_title();
|
||||
let sub = alb
|
||||
.artists
|
||||
.first()
|
||||
|
|
@ -466,9 +470,9 @@ pub fn render_collection(
|
|||
ctx,
|
||||
pal,
|
||||
covers,
|
||||
WidgetId::from_pair("col_ov_alb", &alb.id),
|
||||
WidgetId::from_pair("col_ov_alb", (idx, &alb.id)),
|
||||
cr,
|
||||
&alb.title,
|
||||
&alb_title,
|
||||
sub,
|
||||
alb.cover_uri.as_deref(),
|
||||
&format!("alb_{}", alb.id),
|
||||
|
|
@ -479,7 +483,7 @@ pub fn render_collection(
|
|||
shell.open_entity_menu(EntityContextMenuState {
|
||||
kind: "album".into(),
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title.clone(),
|
||||
subtitle: t.album().into(),
|
||||
cover_uri: alb.cover_uri.clone(),
|
||||
owner_uid: None,
|
||||
|
|
@ -491,12 +495,12 @@ pub fn render_collection(
|
|||
} else if m.play_clicked {
|
||||
actions.push(AppAction::PlayAlbum {
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title,
|
||||
});
|
||||
} else if m.clicked {
|
||||
actions.push(AppAction::Navigate(Route::Album {
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
@ -505,7 +509,7 @@ pub fn render_collection(
|
|||
ctx.end_scroll_h(
|
||||
h_id,
|
||||
pal,
|
||||
albums.len().min(24) as f32 * (card_w + gap),
|
||||
albums.len().min(60) as f32 * (card_w + gap),
|
||||
false,
|
||||
);
|
||||
y += card_h + 26.0;
|
||||
|
|
@ -793,7 +797,7 @@ pub fn render_collection(
|
|||
continue;
|
||||
}
|
||||
let sub = t.count_tracks(pl.track_count as usize);
|
||||
let wid = WidgetId::from_pair("col_pl", format!("{}_{}", pl.owner_uid, pl.kind));
|
||||
let wid = WidgetId::from_pair("col_pl", (i, format!("{}_{}", pl.owner_uid, pl.kind)));
|
||||
let m = media_card(
|
||||
ctx,
|
||||
pal,
|
||||
|
|
@ -805,7 +809,7 @@ pub fn render_collection(
|
|||
pl.cover_uri.as_deref(),
|
||||
&format!("upl_{}_{}", pl.owner_uid, pl.kind),
|
||||
false,
|
||||
false,
|
||||
pl.kind == "3" && pl.cover_uri.is_none(),
|
||||
);
|
||||
|
||||
// Own playlists (not Liked kind=3) get quick Rename & Delete action icons on hover!
|
||||
|
|
@ -928,6 +932,7 @@ pub fn render_collection(
|
|||
card_h,
|
||||
);
|
||||
if cr.bottom() >= rect.top() - 40.0 && cr.top() <= rect.bottom() + 40.0 {
|
||||
let alb_title = alb.full_title();
|
||||
let sub = alb
|
||||
.artists
|
||||
.first()
|
||||
|
|
@ -937,9 +942,9 @@ pub fn render_collection(
|
|||
ctx,
|
||||
pal,
|
||||
covers,
|
||||
WidgetId::from_pair("col_alb", &alb.id),
|
||||
WidgetId::from_pair("col_alb", (idx, &alb.id)),
|
||||
cr,
|
||||
&alb.title,
|
||||
&alb_title,
|
||||
sub,
|
||||
alb.cover_uri.as_deref(),
|
||||
&format!("alb_{}", alb.id),
|
||||
|
|
@ -950,7 +955,7 @@ pub fn render_collection(
|
|||
shell.open_entity_menu(EntityContextMenuState {
|
||||
kind: "album".into(),
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title.clone(),
|
||||
subtitle: t.album().into(),
|
||||
cover_uri: alb.cover_uri.clone(),
|
||||
owner_uid: None,
|
||||
|
|
@ -962,12 +967,12 @@ pub fn render_collection(
|
|||
} else if m.play_clicked {
|
||||
actions.push(AppAction::PlayAlbum {
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title,
|
||||
});
|
||||
} else if m.clicked {
|
||||
actions.push(AppAction::Navigate(Route::Album {
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ pub fn render_detail(
|
|||
};
|
||||
let p_id = format!("{}:{}", owner_uid, kind);
|
||||
let p_seed = format!("pl_{}_{}", owner_uid, kind);
|
||||
let is_likes_art = kind == "3" && pl_cov.is_none();
|
||||
(
|
||||
EntityKind::Playlist {
|
||||
owner_uid: owner_uid.clone(),
|
||||
|
|
@ -156,7 +157,7 @@ pub fn render_detail(
|
|||
pl_cov,
|
||||
p_seed,
|
||||
false,
|
||||
false,
|
||||
is_likes_art,
|
||||
"playlist",
|
||||
p_id,
|
||||
Some(owner_uid),
|
||||
|
|
@ -902,9 +903,10 @@ pub fn render_detail(
|
|||
let h_id = WidgetId::new("artist_albums_hscroll");
|
||||
let sx = ctx.begin_scroll_h(h_id, vp, 0.0);
|
||||
let mut cx = x - sx;
|
||||
for alb in art_detail.albums.iter().take(16) {
|
||||
for (idx, alb) in art_detail.albums.iter().take(48).enumerate() {
|
||||
let cr = Rect::from_xywh(cx, y, card_w, card_h);
|
||||
if cr.right() >= vp.left() - 80.0 && cr.left() <= vp.right() + 80.0 {
|
||||
let alb_title = alb.full_title();
|
||||
let yr = alb
|
||||
.year
|
||||
.map(|yr| yr.to_string())
|
||||
|
|
@ -913,9 +915,9 @@ pub fn render_detail(
|
|||
ctx,
|
||||
pal,
|
||||
covers,
|
||||
WidgetId::from_pair("art_alb", &alb.id),
|
||||
WidgetId::from_pair("art_alb", (idx, &alb.id)),
|
||||
cr,
|
||||
&alb.title,
|
||||
&alb_title,
|
||||
&yr,
|
||||
alb.cover_uri.as_deref(),
|
||||
&format!("artalb_{}", alb.id),
|
||||
|
|
@ -925,12 +927,12 @@ pub fn render_detail(
|
|||
if m.play_clicked {
|
||||
actions.push(AppAction::PlayAlbum {
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title,
|
||||
});
|
||||
} else if m.clicked {
|
||||
actions.push(AppAction::Navigate(Route::Album {
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
@ -939,7 +941,7 @@ pub fn render_detail(
|
|||
ctx.end_scroll_h(
|
||||
h_id,
|
||||
pal,
|
||||
art_detail.albums.len().min(16) as f32 * (card_w + 16.0),
|
||||
art_detail.albums.len().min(48) as f32 * (card_w + 16.0),
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@ pub fn render_for_you(
|
|||
|
||||
let playlists = app.landing.personal_playlists.clone();
|
||||
let mut cx = x - scroll_x;
|
||||
for pl in &playlists {
|
||||
for (idx, pl) in playlists.iter().enumerate() {
|
||||
let cr = Rect::from_xywh(cx, y, card_w, card_h);
|
||||
if cr.right() >= row_vp.left() - 20.0 && cr.left() <= row_vp.right() + 20.0 {
|
||||
let sub = pl.description.as_deref().unwrap_or(t.playlist());
|
||||
|
|
@ -473,7 +473,10 @@ pub fn render_for_you(
|
|||
ctx,
|
||||
pal,
|
||||
covers,
|
||||
WidgetId::from_pair("fy_pl", format!("{}_{}", pl.owner_uid, pl.kind)),
|
||||
WidgetId::from_pair(
|
||||
"fy_pl",
|
||||
(idx, format!("{}_{}", pl.owner_uid, pl.kind)),
|
||||
),
|
||||
cr,
|
||||
&pl.title,
|
||||
sub,
|
||||
|
|
@ -652,14 +655,17 @@ pub fn render_for_you(
|
|||
|
||||
let playlists = app.landing.popular_playlists.clone();
|
||||
let mut cx = x - scroll_x;
|
||||
for pl in &playlists {
|
||||
for (idx, pl) in playlists.iter().enumerate() {
|
||||
let cr = Rect::from_xywh(cx, y, card_w, card_h);
|
||||
if cr.right() >= row_vp.left() - 20.0 && cr.left() <= row_vp.right() + 20.0 {
|
||||
let m = media_card(
|
||||
ctx,
|
||||
pal,
|
||||
covers,
|
||||
WidgetId::from_pair("tr_pl", format!("{}_{}", pl.owner_uid, pl.kind)),
|
||||
WidgetId::from_pair(
|
||||
"tr_pl",
|
||||
(idx, format!("{}_{}", pl.owner_uid, pl.kind)),
|
||||
),
|
||||
cr,
|
||||
&pl.title,
|
||||
&pl.owner_name,
|
||||
|
|
@ -954,8 +960,9 @@ fn render_new_releases_carousel(
|
|||
if row_vp.bottom() >= viewport.top() - 120.0 && row_vp.top() <= viewport.bottom() + 120.0 {
|
||||
let scroll_x = ctx.begin_scroll_h(h_id, row_vp, 0.0);
|
||||
let mut cx = x - scroll_x;
|
||||
for item in &items {
|
||||
for (idx, item) in items.iter().enumerate() {
|
||||
let alb = &item.album;
|
||||
let alb_title = alb.full_title();
|
||||
let outer_r = Rect::from_xywh(cx, y, card_w, card_h);
|
||||
if outer_r.right() >= row_vp.left() - 80.0 && outer_r.left() <= row_vp.right() + 80.0 {
|
||||
// 1. Huge 236x236 circular artist portrait overlapping the bottom card by 56px
|
||||
|
|
@ -1012,7 +1019,7 @@ fn render_new_releases_carousel(
|
|||
.artists
|
||||
.first()
|
||||
.map(|a| a.name.as_str())
|
||||
.unwrap_or(alb.title.as_str());
|
||||
.unwrap_or(alb_title.as_str());
|
||||
let art_lbl_r = Rect::from_xywh(
|
||||
circle_r.left() + 18.0,
|
||||
y + portrait_d - overlap - 54.0,
|
||||
|
|
@ -1028,14 +1035,14 @@ fn render_new_releases_carousel(
|
|||
);
|
||||
|
||||
let port_click_r = Rect::from_xywh(circle_r.left(), circle_r.top(), portrait_d, portrait_d - overlap);
|
||||
let port_resp = ctx.interact(WidgetId::from_pair(salt, format!("port_{}", alb.id)), port_click_r);
|
||||
let port_resp = ctx.interact(WidgetId::from_pair(salt, (idx, format!("port_{}", alb.id))), port_click_r);
|
||||
if port_resp.hovered {
|
||||
ctx.set_cursor(CursorKind::Pointer);
|
||||
}
|
||||
|
||||
// 2. Bottom 80px colored rounded release card (`radius: 14px`)
|
||||
let card_r = Rect::from_xywh(cx, y + portrait_d - overlap, card_w, bottom_h);
|
||||
let card_resp = ctx.interact(WidgetId::from_pair(salt, format!("card_{}", alb.id)), card_r);
|
||||
let card_resp = ctx.interact(WidgetId::from_pair(salt, (idx, format!("card_{}", alb.id))), card_r);
|
||||
let card_bg = if card_resp.hovered {
|
||||
card_tint.lerp(Color::WHITE, 0.08)
|
||||
} else {
|
||||
|
|
@ -1074,7 +1081,7 @@ fn render_new_releases_carousel(
|
|||
// Right 38x38 crisp white circular Play/Pause button
|
||||
let play_c = Pos2::new(card_r.right() - 28.0, card_r.center_y());
|
||||
let play_r = Rect::from_center_size(play_c, Vec2::splat(38.0));
|
||||
let play_resp = ctx.interact(WidgetId::from_pair(salt, format!("play_{}", alb.id)), play_r);
|
||||
let play_resp = ctx.interact(WidgetId::from_pair(salt, (idx, format!("play_{}", alb.id))), play_r);
|
||||
let play_rad = if play_resp.hovered { 20.0 } else { 19.0 };
|
||||
ctx.dl().push_circle(play_c, play_rad, Color::WHITE);
|
||||
let alb_playing = app.is_context_playing(&format!("album:{}", alb.id));
|
||||
|
|
@ -1092,7 +1099,7 @@ fn render_new_releases_carousel(
|
|||
let tx_l = cov_r.right() + 12.0;
|
||||
let tx_w = (play_r.left() - tx_l - 8.0).max(40.0);
|
||||
ctx.draw_text_ellipsis(
|
||||
&alb.title,
|
||||
&alb_title,
|
||||
TextStyle::bold(14.5, Color::WHITE),
|
||||
Rect::from_xywh(tx_l, card_r.top() + 18.0, tx_w, 20.0),
|
||||
TextAlign::Left,
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ pub struct ShellUiState {
|
|||
pub queue_drag: Option<QueueDragState>,
|
||||
pub fs_lyrics_scroll_y: f32,
|
||||
pub fs_lyrics_manual_until: f64,
|
||||
pub fs_lyrics_upper_until: f64,
|
||||
pub fs_lyrics_last_mouse: Option<Pos2>,
|
||||
pub fs_lyrics_track_id: String,
|
||||
}
|
||||
|
||||
|
|
@ -640,37 +642,9 @@ pub fn render_fullscreen_player(
|
|||
ctx.register_blocker(screen);
|
||||
ctx.dl().push_rect(screen, 0.0, bg_color);
|
||||
|
||||
// Top-right circular `v` collapse button (`FullscreenPlayerDesktop_closeButton`)
|
||||
let close_r = Rect::from_center_size(
|
||||
Pos2::new(screen.right() - 44.0, screen.top() + 56.0),
|
||||
Vec2::splat(40.0),
|
||||
);
|
||||
let close_resp = ctx.interact(WidgetId::new("fs_close"), close_r);
|
||||
ctx.dl().push_circle(
|
||||
close_r.center(),
|
||||
if close_resp.hovered { 21.0 } else { 20.0 },
|
||||
if close_resp.hovered {
|
||||
css_rgba(255, 255, 255, 36)
|
||||
} else {
|
||||
css_rgba(255, 255, 255, 22)
|
||||
},
|
||||
);
|
||||
ctx.draw_icon(
|
||||
Icon::ArrowDown,
|
||||
Rect::from_center_size(close_r.center(), Vec2::splat(24.0)),
|
||||
Color::WHITE,
|
||||
);
|
||||
if close_resp.hovered {
|
||||
ctx.set_cursor(CursorKind::Pointer);
|
||||
ctx.show_tooltip(close_r, i18n.close());
|
||||
}
|
||||
if close_resp.clicked {
|
||||
actions.push(AppAction::SetFullscreen(false));
|
||||
}
|
||||
|
||||
let Some(tr) = track else {
|
||||
return;
|
||||
};
|
||||
// Render track player + 50/50 split BEFORE top-right `v` collapse button so
|
||||
// SyncLyrics top gradient fade mask never slices over `FullscreenPlayerDesktop_closeButton`!
|
||||
if let Some(tr) = track {
|
||||
|
||||
// Mutually exclusive right split modes (SyncLyrics OR PlayQueue) WITHOUT closing fullscreen!
|
||||
let is_split = app.fullscreen_lyrics_open || app.fullscreen_queue_open;
|
||||
|
|
@ -692,7 +666,8 @@ pub fn render_fullscreen_player(
|
|||
let cx_center = screen.center_x();
|
||||
let cx_left = screen.left() + screen.width() * 0.25;
|
||||
let cx = cx_center + (cx_left - cx_center) * split_t;
|
||||
let cov_cy = screen.center_y() - 36.0;
|
||||
// Center the entire (poster + 110px info) block symmetrically around `screen.center_y()`
|
||||
let cov_cy = screen.center_y() - 55.0;
|
||||
let cov_r = Rect::from_center_size(Pos2::new(cx, cov_cy), Vec2::splat(cov_sz));
|
||||
|
||||
// Soft cover elevation shadow
|
||||
|
|
@ -956,7 +931,7 @@ pub fn render_fullscreen_player(
|
|||
}
|
||||
|
||||
// Below Cover: Clickable Track Title + Explicit + Individually Clickable Artists
|
||||
let title_y = cov_r.bottom() + 20.0;
|
||||
let title_y = cov_r.bottom() + 24.0;
|
||||
let meta_w = cov_sz.max(320.0);
|
||||
let full_title = tr.full_title();
|
||||
let measured_tw = ctx
|
||||
|
|
@ -1003,7 +978,7 @@ pub fn render_fullscreen_player(
|
|||
}
|
||||
|
||||
// Individually clickable artists below title (`SeparatedArtists`)!
|
||||
let art_r = Rect::from_center_size(Pos2::new(cx, title_y + 34.0), Vec2::new(meta_w, 22.0));
|
||||
let art_r = Rect::from_xywh(cx - meta_w * 0.5, title_y + 26.0, meta_w, 22.0);
|
||||
if let Some((aid, aname)) = separated_artists(
|
||||
ctx,
|
||||
pal,
|
||||
|
|
@ -1020,7 +995,7 @@ pub fn render_fullscreen_player(
|
|||
}
|
||||
|
||||
// Progress bar (`ChangeTimecode`: 4px `#E6E6E6` fill/thumb + hover timecodes + smooth drag seek)
|
||||
let bar_y = title_y + 64.0;
|
||||
let bar_y = cov_r.bottom() + 86.0;
|
||||
let bar_hit = Rect::from_center_size(Pos2::new(cx, bar_y), Vec2::new(cov_sz, 22.0));
|
||||
let bar_resp = ctx.interact(WidgetId::new("fs_progress"), bar_hit);
|
||||
let bar_r = Rect::from_center_size(Pos2::new(cx, bar_y), Vec2::new(cov_sz, 4.0));
|
||||
|
|
@ -1090,13 +1065,24 @@ pub fn render_fullscreen_player(
|
|||
ctx.dl().push_circle(Pos2::new(fill_x, bar_y), 6.0, fill_col);
|
||||
}
|
||||
|
||||
// Right-Half 50/50 Animated Pane: SyncLyrics OR PlayQueue!
|
||||
// Right-Half 50/50 Animated Pane (`FullscreenPlayerDesktopContent_additionalContent`): SyncLyrics OR PlayQueue!
|
||||
if split_t > 0.02 {
|
||||
let right_rect = Rect::from_min_max(
|
||||
Pos2::new(screen.left() + screen.width() * 0.48, screen.top() + 56.0),
|
||||
Pos2::new(screen.right() - 48.0, screen.bottom() - 40.0),
|
||||
);
|
||||
let indent = if screen.width() > 1060.0 {
|
||||
44.0
|
||||
} else if screen.width() > 960.0 {
|
||||
20.0
|
||||
} else {
|
||||
10.0
|
||||
};
|
||||
let right_left = screen.left() + screen.width() * 0.50 - indent;
|
||||
let right_right = (right_left + screen.width() * 0.50).min(screen.right());
|
||||
let right_bottom = screen.bottom() - (screen.height() * 0.09).max(56.0);
|
||||
|
||||
if app.fullscreen_queue_open {
|
||||
let right_rect = Rect::from_min_max(
|
||||
Pos2::new(right_left, screen.top() + 56.0),
|
||||
Pos2::new((right_right - 48.0).max(right_left + 120.0), right_bottom),
|
||||
);
|
||||
ctx.draw_text_ellipsis(
|
||||
i18n.queue(),
|
||||
TextStyle::headline(22.0, Color::WHITE.with_alpha_f32(split_t)),
|
||||
|
|
@ -1119,12 +1105,17 @@ pub fn render_fullscreen_player(
|
|||
actions,
|
||||
);
|
||||
} else {
|
||||
let lyr_rect = Rect::from_min_max(
|
||||
Pos2::new(right_left, screen.top() + 32.0),
|
||||
Pos2::new(right_right, right_bottom),
|
||||
);
|
||||
render_fullscreen_sync_lyrics(
|
||||
ctx,
|
||||
app.current_lyrics.as_ref(),
|
||||
tr,
|
||||
position_ms,
|
||||
right_rect,
|
||||
is_playing,
|
||||
lyr_rect,
|
||||
bg_color,
|
||||
split_t,
|
||||
ru,
|
||||
|
|
@ -1133,13 +1124,41 @@ pub fn render_fullscreen_player(
|
|||
);
|
||||
}
|
||||
}
|
||||
// Bottom-right Volume / Mute button with upward 44×216 `ym_volume_capsule` hover popover!
|
||||
// Smoothly shifts into the left player column when `split_t > 0` so neither the button nor
|
||||
// its upward popover ever collides with `right_rect` (SyncLyrics / Queue split pane).
|
||||
let vol_x_centered = screen.right() - 44.0;
|
||||
let vol_x_split = (screen.left() + screen.width() * 0.48 - 34.0).max(screen.left() + 44.0);
|
||||
let vol_x = vol_x_centered + (vol_x_split - vol_x_centered) * split_t;
|
||||
let vol_center = Pos2::new(vol_x, screen.bottom() - 44.0);
|
||||
} // end `if let Some(tr) = track`
|
||||
|
||||
// Top-right circular `v` collapse button (`FullscreenPlayerDesktop_closeButton`, z-index: header)
|
||||
let close_r = Rect::from_center_size(
|
||||
Pos2::new(screen.right() - 44.0, screen.top() + 56.0),
|
||||
Vec2::splat(40.0),
|
||||
);
|
||||
let close_resp = ctx.interact(WidgetId::new("fs_close"), close_r);
|
||||
ctx.dl().push_circle(
|
||||
close_r.center(),
|
||||
if close_resp.hovered { 21.0 } else { 20.0 },
|
||||
if close_resp.hovered {
|
||||
css_rgba(255, 255, 255, 36)
|
||||
} else {
|
||||
css_rgba(255, 255, 255, 22)
|
||||
},
|
||||
);
|
||||
ctx.draw_icon(
|
||||
Icon::ArrowDown,
|
||||
Rect::from_center_size(close_r.center(), Vec2::splat(24.0)),
|
||||
Color::WHITE,
|
||||
);
|
||||
if close_resp.hovered {
|
||||
ctx.set_cursor(CursorKind::Pointer);
|
||||
ctx.show_tooltip(close_r, i18n.close());
|
||||
}
|
||||
if close_resp.clicked {
|
||||
actions.push(AppAction::SetFullscreen(false));
|
||||
}
|
||||
|
||||
if track.is_none() {
|
||||
return;
|
||||
}
|
||||
// Bottom-right Volume / Mute button anchored cleanly at bottom-right aligned with top-right `v`!
|
||||
let vol_center = Pos2::new(screen.right() - 44.0, screen.bottom() - 40.0);
|
||||
let vol_btn_r = Rect::from_center_size(vol_center, Vec2::splat(40.0));
|
||||
let vol_resp = ctx.interact(WidgetId::new("fs_vol_btn"), vol_btn_r);
|
||||
let vol_val = app.config.volume;
|
||||
|
|
@ -1207,12 +1226,19 @@ pub fn render_fullscreen_player(
|
|||
});
|
||||
}
|
||||
|
||||
/// 1-to-1 Official `SyncLyrics` (`83ceed5f9f3f6e01.css` + `9631.422e0bf38581fe75.js`):
|
||||
/// - `40vh` active anchor, `32px` Swiper spacing, `base_sz` `(2.5vw clamped 32..48px)`, `scale(1.2)` active line
|
||||
/// - `INTRO` 4 staggered pulsing dots + `PREPARE` `3/2/1` countdown slot above line 0
|
||||
/// - `withVisibleUpperLyrics` (3s on mouse move) & `withVisibleScrolledLyrics` (3s on wheel scroll)
|
||||
/// - Exact opacity ladder (`1.0` active, `0.30` next, `0.10` upcoming / upper-visible, `0.0` hidden past)
|
||||
/// - Official `SyncLyricsFooter` (`Авторы:` / `Writers:` + `Источник:` / `Source:`) + `80px` top/bottom fades
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn render_fullscreen_sync_lyrics(
|
||||
ctx: &mut UiContext,
|
||||
lyrics: Option<&TrackLyrics>,
|
||||
track: &Track,
|
||||
position_ms: u64,
|
||||
is_playing: bool,
|
||||
lyr_rect: Rect,
|
||||
bg_color: Color,
|
||||
split_t: f32,
|
||||
|
|
@ -1224,6 +1250,8 @@ fn render_fullscreen_sync_lyrics(
|
|||
shell.fs_lyrics_track_id = track.id.clone();
|
||||
shell.fs_lyrics_scroll_y = 0.0;
|
||||
shell.fs_lyrics_manual_until = 0.0;
|
||||
shell.fs_lyrics_upper_until = 0.0;
|
||||
shell.fs_lyrics_last_mouse = None;
|
||||
}
|
||||
|
||||
let Some(lyr) = lyrics.filter(|l| !l.lines.is_empty()) else {
|
||||
|
|
@ -1241,52 +1269,85 @@ fn render_fullscreen_sync_lyrics(
|
|||
return;
|
||||
};
|
||||
|
||||
let active_idx = if lyr.is_synced {
|
||||
lyr.lines
|
||||
.iter()
|
||||
.rposition(|l| l.time_ms <= position_ms)
|
||||
.unwrap_or(0)
|
||||
let screen = ctx.screen_rect();
|
||||
let screen_w = screen.width();
|
||||
let base_sz = (screen_w * 0.025).clamp(32.0, 48.0).round();
|
||||
let active_sz = (base_sz * 1.2).round();
|
||||
let base_lh = (base_sz * 1.25).round();
|
||||
let active_lh = (active_sz * 1.25).round();
|
||||
let max_line_w = (lyr_rect.width() * 0.80).max(200.0);
|
||||
let line_gap = 32.0f32; // exact Swiper `spaceBetween: 32`
|
||||
|
||||
// Exact `--sync-lyrics-scroller-inset-top-vh: 40vh` anchor
|
||||
let anchor_y = (screen.top() + screen.height() * 0.40)
|
||||
.clamp(lyr_rect.top() + 48.0, lyr_rect.bottom() - 80.0);
|
||||
|
||||
// Exact state machine: INTRO / PREPARE / PLAYING
|
||||
let start_ms = lyr.lines.first().map_or(0, |l| l.time_ms);
|
||||
let is_prepare = lyr.is_synced
|
||||
&& start_ms >= 3000
|
||||
&& position_ms < start_ms
|
||||
&& (start_ms - position_ms) <= 3000;
|
||||
let is_intro = lyr.is_synced && start_ms > 0 && position_ms < start_ms && !is_prepare;
|
||||
let active_idx: Option<usize> = if lyr.is_synced && !is_intro && !is_prepare {
|
||||
lyr.lines.iter().rposition(|l| l.time_ms <= position_ms)
|
||||
} else {
|
||||
usize::MAX
|
||||
None
|
||||
};
|
||||
|
||||
let screen_w = ctx.screen_rect().width();
|
||||
let base_sz = (screen_w * 0.022).clamp(24.0, 32.0);
|
||||
let active_sz = base_sz * 1.15;
|
||||
let max_line_w = (lyr_rect.width() - 48.0).max(200.0);
|
||||
|
||||
// Pre-measure lines
|
||||
// Pre-measure every line at fixed `base_sz` / `base_lh` (zero wrap-jumping during `scale(1.2)`)
|
||||
let measure_style = TextStyle::headline(base_sz, Color::WHITE).with_line_height(base_lh);
|
||||
let mut line_heights = Vec::with_capacity(lyr.lines.len());
|
||||
let mut line_y = Vec::with_capacity(lyr.lines.len());
|
||||
let mut cur_y = 0.0f32;
|
||||
for (i, line) in lyr.lines.iter().enumerate() {
|
||||
let is_active = i == active_idx;
|
||||
let sz = if is_active { active_sz } else { base_sz };
|
||||
for line in &lyr.lines {
|
||||
let txt = if line.text.trim().is_empty() {
|
||||
"• • •"
|
||||
} else {
|
||||
line.text.as_str()
|
||||
};
|
||||
let measured = ctx.measure_text(txt, TextStyle::headline(sz, Color::WHITE), Some(max_line_w));
|
||||
let h = measured.y.max(sz * 1.25);
|
||||
let measured = ctx.measure_text(txt, measure_style, Some(max_line_w));
|
||||
let h = measured.y.max(base_lh);
|
||||
line_y.push(cur_y + h * 0.5);
|
||||
line_heights.push(h);
|
||||
cur_y += h + 22.0;
|
||||
cur_y += h + line_gap;
|
||||
}
|
||||
let total_h = cur_y;
|
||||
let counter_y = -(line_gap + 22.0);
|
||||
let min_scroll = if is_intro || is_prepare { counter_y } else { 0.0 };
|
||||
|
||||
let now_t = ctx.input.time;
|
||||
let dt = ctx.input.dt;
|
||||
|
||||
// Mouse movement (`> 2px`) reveals past upper lines for 3s (`withVisibleUpperLyrics`)
|
||||
if let Some(pos) = ctx.input.pointer_pos {
|
||||
if let Some(prev) = shell.fs_lyrics_last_mouse {
|
||||
if pos.distance(prev) > 2.0 {
|
||||
shell.fs_lyrics_upper_until = now_t + 3.0;
|
||||
shell.fs_lyrics_last_mouse = Some(pos);
|
||||
}
|
||||
} else {
|
||||
shell.fs_lyrics_last_mouse = Some(pos);
|
||||
}
|
||||
}
|
||||
|
||||
// Wheel scroll enters manual browse mode for 3s (`withVisibleScrolledLyrics`)
|
||||
let wheel_dy = if ctx.is_hovered(lyr_rect) {
|
||||
ctx.input.wheel_delta.y
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
if wheel_dy.abs() > 0.25 {
|
||||
shell.fs_lyrics_scroll_y = (shell.fs_lyrics_scroll_y - wheel_dy).clamp(0.0, total_h.max(0.0));
|
||||
shell.fs_lyrics_scroll_y = (shell.fs_lyrics_scroll_y - wheel_dy).clamp(min_scroll, total_h.max(0.0));
|
||||
shell.fs_lyrics_manual_until = now_t + 3.0;
|
||||
} else if lyr.is_synced && active_idx < line_y.len() && now_t >= shell.fs_lyrics_manual_until {
|
||||
let target_y = line_y[active_idx];
|
||||
} else if lyr.is_synced && now_t >= shell.fs_lyrics_manual_until {
|
||||
let target_y = if is_intro || is_prepare {
|
||||
counter_y
|
||||
} else if let Some(act) = active_idx {
|
||||
line_y[act]
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let alpha = 1.0 - (-dt * 7.5).exp();
|
||||
shell.fs_lyrics_scroll_y += (target_y - shell.fs_lyrics_scroll_y) * alpha;
|
||||
if (target_y - shell.fs_lyrics_scroll_y).abs() > 0.4 {
|
||||
|
|
@ -1295,82 +1356,190 @@ fn render_fullscreen_sync_lyrics(
|
|||
}
|
||||
|
||||
let manual_scrolled = now_t < shell.fs_lyrics_manual_until;
|
||||
let center_y = lyr_rect.center_y();
|
||||
let upper_visible = now_t < shell.fs_lyrics_upper_until;
|
||||
let lyr_cx = lyr_rect.center_x();
|
||||
|
||||
ctx.push_clip(lyr_rect, 0.0);
|
||||
|
||||
// Counter / Loader slot above line 0 (`INTRO`: 4 staggered pulsing dots; `PREPARE`: "3"/"2"/"1")
|
||||
if is_intro || is_prepare {
|
||||
let cy_screen = anchor_y + (counter_y - shell.fs_lyrics_scroll_y);
|
||||
if cy_screen >= lyr_rect.top() - 40.0 && cy_screen <= lyr_rect.bottom() + 40.0 {
|
||||
if is_prepare {
|
||||
let rem_ms = start_ms.saturating_sub(position_ms);
|
||||
let digit = ((rem_ms.saturating_sub(1)) / 1000 + 1).clamp(1, 3);
|
||||
ctx.draw_text_ellipsis(
|
||||
&digit.to_string(),
|
||||
TextStyle::headline(base_sz, Color::WHITE.with_alpha_f32(0.50 * split_t)),
|
||||
Rect::from_center_size(Pos2::new(lyr_cx, cy_screen), Vec2::new(80.0, base_lh)),
|
||||
TextAlign::Center,
|
||||
);
|
||||
} else {
|
||||
let spacing = 20.0f32;
|
||||
let start_x = lyr_cx - spacing * 1.5;
|
||||
for k in 0..4 {
|
||||
let (dy, dot_a) = if is_playing {
|
||||
let phase = (now_t as f32 * 4.2 - k as f32 * 0.55).sin();
|
||||
(-phase.max(0.0) * 6.0, (0.30 + 0.55 * (phase * 0.5 + 0.5)) * split_t)
|
||||
} else {
|
||||
(0.0, 0.35 * split_t)
|
||||
};
|
||||
ctx.dl().push_circle(
|
||||
Pos2::new(start_x + k as f32 * spacing, cy_screen + dy),
|
||||
5.5,
|
||||
Color::WHITE.with_alpha_f32(dot_a),
|
||||
);
|
||||
}
|
||||
if is_playing {
|
||||
ctx.request_repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i, line) in lyr.lines.iter().enumerate() {
|
||||
let y_screen = center_y + (line_y[i] - shell.fs_lyrics_scroll_y);
|
||||
let y_screen = anchor_y + (line_y[i] - shell.fs_lyrics_scroll_y);
|
||||
let h = line_heights[i];
|
||||
if y_screen + h * 0.5 < lyr_rect.top() - 40.0 || y_screen - h * 0.5 > lyr_rect.bottom() + 40.0 {
|
||||
let is_active = !manual_scrolled && active_idx == Some(i);
|
||||
|
||||
let target_op: f32 = if !lyr.is_synced || manual_scrolled {
|
||||
1.0
|
||||
} else if is_intro || is_prepare {
|
||||
if i == 0 { 0.30 } else { 0.10 }
|
||||
} else if let Some(act) = active_idx {
|
||||
if i == act {
|
||||
1.0
|
||||
} else if i == act + 1 {
|
||||
0.30
|
||||
} else if i > act + 1 {
|
||||
0.10
|
||||
} else if upper_visible {
|
||||
0.10
|
||||
} else {
|
||||
0.0
|
||||
}
|
||||
} else {
|
||||
0.10
|
||||
};
|
||||
|
||||
let op_t = ctx.animate_f32(WidgetId::from_pair("fs_lyr_op", i), target_op, 0.45);
|
||||
let act_t = ctx.animate_bool(WidgetId::from_pair("fs_lyr_act", i), is_active, 0.45);
|
||||
|
||||
if y_screen + h * 0.65 < lyr_rect.top() - 48.0
|
||||
|| y_screen - h * 0.65 > lyr_rect.bottom() + 48.0
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
let is_active = i == active_idx;
|
||||
let is_next = active_idx != usize::MAX && i == active_idx + 1;
|
||||
let hit_r = Rect::from_center_size(Pos2::new(lyr_cx, y_screen), Vec2::new(max_line_w, h + 12.0));
|
||||
let line_visible = op_t > 0.02 || manual_scrolled || upper_visible || !lyr.is_synced;
|
||||
let hit_r = Rect::from_center_size(Pos2::new(lyr_cx, y_screen), Vec2::new(max_line_w, h + 14.0));
|
||||
let resp = ctx.interact(WidgetId::from_pair("fs_lyr_ln", i), hit_r);
|
||||
|
||||
let act_t = ctx.animate_bool(WidgetId::from_pair("fs_lyr_act", i), is_active, 0.35);
|
||||
let hov_t = ctx.animate_bool(
|
||||
WidgetId::from_pair("fs_lyr_hov", i),
|
||||
resp.hovered && lyr.is_synced,
|
||||
resp.hovered && lyr.is_synced && line_visible,
|
||||
0.18,
|
||||
);
|
||||
|
||||
let base_alpha = if !lyr.is_synced || manual_scrolled {
|
||||
0.90f32
|
||||
} else if is_next {
|
||||
0.34
|
||||
} else {
|
||||
0.16
|
||||
};
|
||||
let alpha = (base_alpha + (1.0 - base_alpha) * act_t)
|
||||
.max(0.90 * hov_t)
|
||||
* split_t;
|
||||
let sz = base_sz + (active_sz - base_sz) * act_t;
|
||||
let col = Color::WHITE.with_alpha_f32(alpha);
|
||||
let txt = if line.text.trim().is_empty() {
|
||||
"• • •"
|
||||
} else {
|
||||
line.text.as_str()
|
||||
};
|
||||
let alpha = op_t.max(0.85 * hov_t) * split_t;
|
||||
if alpha > 0.005 {
|
||||
let col = Color::WHITE.with_alpha_f32(alpha);
|
||||
let txt = if line.text.trim().is_empty() {
|
||||
"• • •"
|
||||
} else {
|
||||
line.text.as_str()
|
||||
};
|
||||
|
||||
let draw_r = Rect::from_center_size(Pos2::new(lyr_cx, y_screen), Vec2::new(max_line_w, h + 6.0));
|
||||
ctx.draw_text_wrapped(txt, TextStyle::headline(sz, col), draw_r, None, TextAlign::Center);
|
||||
if act_t < 0.01 {
|
||||
ctx.draw_text_wrapped_scaled(
|
||||
txt,
|
||||
TextStyle::headline(base_sz, col).with_line_height(base_lh),
|
||||
Rect::from_center_size(Pos2::new(lyr_cx, y_screen), Vec2::new(max_line_w, h)),
|
||||
1.0,
|
||||
TextAlign::Center,
|
||||
);
|
||||
} else {
|
||||
let sc = (1.0 + 0.2 * act_t) / 1.2;
|
||||
ctx.draw_text_wrapped_scaled(
|
||||
txt,
|
||||
TextStyle::headline(active_sz, col).with_line_height(active_lh),
|
||||
Rect::from_center_size(
|
||||
Pos2::new(lyr_cx, y_screen),
|
||||
Vec2::new(max_line_w * 1.2, h * 1.2),
|
||||
),
|
||||
sc,
|
||||
TextAlign::Center,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if lyr.is_synced {
|
||||
if lyr.is_synced && line_visible {
|
||||
if resp.hovered {
|
||||
ctx.set_cursor(CursorKind::Pointer);
|
||||
}
|
||||
if resp.clicked {
|
||||
actions.push(AppAction::SeekMs(line.time_ms));
|
||||
actions.push(AppAction::SeekMs(line.time_ms.saturating_add(10)));
|
||||
shell.fs_lyrics_manual_until = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Writers footer
|
||||
if let Some(ref writers) = lyr.writers {
|
||||
let fy = center_y + (total_h + 24.0 - shell.fs_lyrics_scroll_y);
|
||||
if fy >= lyr_rect.top() - 40.0 && fy <= lyr_rect.bottom() + 40.0 {
|
||||
// Official `SyncLyricsFooter`: Writers + Source (`major`) attribution at `0.50` alpha
|
||||
let has_writers = lyr.writers.as_deref().map_or(false, |s| !s.trim().is_empty());
|
||||
let has_major = lyr.major.as_deref().map_or(false, |s| !s.trim().is_empty());
|
||||
if has_writers || has_major {
|
||||
let footer_pad_top = (screen_w * 0.0625).clamp(48.0, 96.0);
|
||||
let footer_sz = (screen_w * 0.0125).clamp(15.0, 20.0);
|
||||
let footer_col = Color::WHITE.with_alpha_f32(0.50 * split_t);
|
||||
let footer_style = TextStyle::medium(footer_sz, footer_col);
|
||||
let mut fy = anchor_y + (total_h + footer_pad_top - shell.fs_lyrics_scroll_y);
|
||||
|
||||
if let Some(ref writers) = lyr.writers.as_deref().filter(|s| !s.trim().is_empty()) {
|
||||
let txt = if ru {
|
||||
format!("Авторы: {}", writers)
|
||||
} else {
|
||||
format!("Writers: {}", writers)
|
||||
};
|
||||
ctx.draw_text_wrapped(
|
||||
&txt,
|
||||
TextStyle::regular(14.0, Color::WHITE.with_alpha_f32(0.5 * split_t)),
|
||||
Rect::from_center_size(Pos2::new(lyr_cx, fy), Vec2::new(max_line_w, 40.0)),
|
||||
Some(2),
|
||||
TextAlign::Center,
|
||||
);
|
||||
let mh = ctx
|
||||
.measure_text(&txt, footer_style, Some(max_line_w))
|
||||
.y
|
||||
.max(footer_sz * 1.35);
|
||||
if fy + mh >= lyr_rect.top() - 40.0 && fy <= lyr_rect.bottom() + 40.0 {
|
||||
ctx.draw_text_wrapped(
|
||||
&txt,
|
||||
footer_style,
|
||||
Rect::from_xywh(lyr_cx - max_line_w * 0.5, fy, max_line_w, mh + 4.0),
|
||||
Some(3),
|
||||
TextAlign::Center,
|
||||
);
|
||||
}
|
||||
fy += mh + 8.0;
|
||||
}
|
||||
|
||||
if let Some(ref major) = lyr.major.as_deref().filter(|s| !s.trim().is_empty()) {
|
||||
let txt = if ru {
|
||||
format!("Источник: {}", major)
|
||||
} else {
|
||||
format!("Source: {}", major)
|
||||
};
|
||||
let mh = ctx
|
||||
.measure_text(&txt, footer_style, Some(max_line_w))
|
||||
.y
|
||||
.max(footer_sz * 1.35);
|
||||
if fy + mh >= lyr_rect.top() - 40.0 && fy <= lyr_rect.bottom() + 40.0 {
|
||||
ctx.draw_text_wrapped(
|
||||
&txt,
|
||||
footer_style,
|
||||
Rect::from_xywh(lyr_cx - max_line_w * 0.5, fy, max_line_w, mh + 4.0),
|
||||
Some(2),
|
||||
TextAlign::Center,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Smooth top & bottom gradient fade masks into `bg_color`
|
||||
let fade_h = 84.0f32.min(lyr_rect.height() * 0.22);
|
||||
// Official `80px` (`5rem`) top & bottom gradient fade masks into `bg_color`
|
||||
let fade_h = 80.0f32.min(lyr_rect.height() * 0.25);
|
||||
let bg_clear = bg_color.with_alpha(0);
|
||||
ctx.dl().push_gradient_rect(
|
||||
Rect::from_xywh(lyr_rect.left(), lyr_rect.top(), lyr_rect.width(), fade_h),
|
||||
|
|
|
|||
|
|
@ -1194,7 +1194,7 @@ pub fn render_concerts(
|
|||
ctx.request_repaint();
|
||||
let t_sec = app.start_time.elapsed().as_secs_f32() * 3.0;
|
||||
|
||||
// 3 featured shimmer poster cards
|
||||
// 3 featured shimmer poster cards (matching official 0.963 TopConcertsCarousel aspect ratio)
|
||||
let gap = 16.0;
|
||||
let f_cols = if avail_w >= 860.0 {
|
||||
3usize
|
||||
|
|
@ -1203,16 +1203,17 @@ pub fn render_concerts(
|
|||
} else {
|
||||
1
|
||||
};
|
||||
let f_w = ((avail_w - gap * (f_cols as f32 - 1.0)) / f_cols as f32).max(220.0);
|
||||
let f_w = ((avail_w - gap * (f_cols as f32 - 1.0)) / f_cols as f32).clamp(240.0, 440.0);
|
||||
let f_h = (f_w / 0.963).clamp(240.0, 320.0);
|
||||
for i in 0..f_cols {
|
||||
let col = shimmer_color(pal, t_sec + i as f32 * 0.55);
|
||||
ctx.dl().push_rect(
|
||||
Rect::from_xywh(x + i as f32 * (f_w + gap), y, f_w, 210.0),
|
||||
Rect::from_xywh(x + i as f32 * (f_w + gap), y, f_w, f_h),
|
||||
16.0,
|
||||
col,
|
||||
);
|
||||
}
|
||||
y += 236.0;
|
||||
y += f_h + 26.0;
|
||||
|
||||
// 4 shimmer feed rows
|
||||
for i in 0..4 {
|
||||
|
|
@ -1276,7 +1277,7 @@ pub fn render_concerts(
|
|||
}
|
||||
.max(1);
|
||||
let f_w = ((avail_w - gap * (f_cols as f32 - 1.0)) / f_cols as f32).clamp(240.0, 440.0);
|
||||
let f_h = 216.0;
|
||||
let f_h = (f_w / 0.963).clamp(240.0, 320.0);
|
||||
|
||||
ctx.draw_text_ellipsis(
|
||||
if ru { "Рекомендуем" } else { "Featured" },
|
||||
|
|
|
|||
|
|
@ -339,8 +339,9 @@ pub fn render_search(
|
|||
false,
|
||||
false,
|
||||
);
|
||||
let balb_title = balb.full_title();
|
||||
ctx.draw_text_ellipsis(
|
||||
&balb.title,
|
||||
&balb_title,
|
||||
TextStyle::bold(16.5, pal.text_bright),
|
||||
Rect::from_xywh(text_x, card_r.top() + 22.0, text_w, 24.0),
|
||||
TextAlign::Left,
|
||||
|
|
@ -726,8 +727,9 @@ pub fn render_search(
|
|||
let h_id = WidgetId::new("search_albums_hscroll");
|
||||
let sx = ctx.begin_scroll_h(h_id, row_vp, 0.0);
|
||||
let mut cx = x - sx;
|
||||
for alb in res.albums.iter().take(12) {
|
||||
for (idx, alb) in res.albums.iter().take(12).enumerate() {
|
||||
let cr = Rect::from_xywh(cx, y, card_w, card_h);
|
||||
let alb_title = alb.full_title();
|
||||
let sub = alb
|
||||
.artists
|
||||
.first()
|
||||
|
|
@ -737,9 +739,9 @@ pub fn render_search(
|
|||
ctx,
|
||||
pal,
|
||||
covers,
|
||||
WidgetId::from_pair("s_alb", &alb.id),
|
||||
WidgetId::from_pair("s_alb", (idx, &alb.id)),
|
||||
cr,
|
||||
&alb.title,
|
||||
&alb_title,
|
||||
sub,
|
||||
alb.cover_uri.as_deref(),
|
||||
&format!("alb_{}", alb.id),
|
||||
|
|
@ -749,12 +751,12 @@ pub fn render_search(
|
|||
if m.play_clicked {
|
||||
actions.push(AppAction::PlayAlbum {
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title,
|
||||
});
|
||||
} else if m.clicked {
|
||||
actions.push(AppAction::Navigate(Route::Album {
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title,
|
||||
}));
|
||||
}
|
||||
cx += card_w + 16.0;
|
||||
|
|
@ -776,6 +778,7 @@ pub fn render_search(
|
|||
card_h,
|
||||
);
|
||||
if cr.bottom() >= body_vp.top() - 40.0 && cr.top() <= body_vp.bottom() + 40.0 {
|
||||
let alb_title = alb.full_title();
|
||||
let sub = alb
|
||||
.artists
|
||||
.first()
|
||||
|
|
@ -785,9 +788,9 @@ pub fn render_search(
|
|||
ctx,
|
||||
pal,
|
||||
covers,
|
||||
WidgetId::from_pair("s_alb_grid", &alb.id),
|
||||
WidgetId::from_pair("s_alb_grid", (idx, &alb.id)),
|
||||
cr,
|
||||
&alb.title,
|
||||
&alb_title,
|
||||
sub,
|
||||
alb.cover_uri.as_deref(),
|
||||
&format!("alb_{}", alb.id),
|
||||
|
|
@ -797,12 +800,12 @@ pub fn render_search(
|
|||
if m.play_clicked {
|
||||
actions.push(AppAction::PlayAlbum {
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title,
|
||||
});
|
||||
} else if m.clicked {
|
||||
actions.push(AppAction::Navigate(Route::Album {
|
||||
id: alb.id.clone(),
|
||||
title: alb.title.clone(),
|
||||
title: alb_title,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
@ -831,13 +834,16 @@ pub fn render_search(
|
|||
let h_id = WidgetId::new("search_playlists_hscroll");
|
||||
let sx = ctx.begin_scroll_h(h_id, row_vp, 0.0);
|
||||
let mut cx = x - sx;
|
||||
for pl in res.playlists.iter().take(12) {
|
||||
for (idx, pl) in res.playlists.iter().take(12).enumerate() {
|
||||
let cr = Rect::from_xywh(cx, y, card_w, card_h);
|
||||
let m = media_card(
|
||||
ctx,
|
||||
pal,
|
||||
covers,
|
||||
WidgetId::from_pair("s_pl", format!("{}_{}", pl.owner_uid, pl.kind)),
|
||||
WidgetId::from_pair(
|
||||
"s_pl",
|
||||
(idx, format!("{}_{}", pl.owner_uid, pl.kind)),
|
||||
),
|
||||
cr,
|
||||
&pl.title,
|
||||
&pl.owner_name,
|
||||
|
|
@ -889,7 +895,7 @@ pub fn render_search(
|
|||
covers,
|
||||
WidgetId::from_pair(
|
||||
"s_pl_grid",
|
||||
format!("{}_{}", pl.owner_uid, pl.kind),
|
||||
(idx, format!("{}_{}", pl.owner_uid, pl.kind)),
|
||||
),
|
||||
cr,
|
||||
&pl.title,
|
||||
|
|
|
|||
|
|
@ -287,6 +287,8 @@ pub fn render_sidebar(
|
|||
};
|
||||
let cover_rect = Rect::from_center_size(cover_center, Vec2::splat(40.0));
|
||||
let is_circle = pin.kind == "artist" || is_wave;
|
||||
let is_likes_art = pin.kind == "likes"
|
||||
|| (pin.kind == "playlist" && pin.id.ends_with(":3") && pin.cover_uri.is_none());
|
||||
draw_cover_art(
|
||||
ctx,
|
||||
pal,
|
||||
|
|
@ -296,7 +298,7 @@ pub fn render_sidebar(
|
|||
&pin.id,
|
||||
4.0,
|
||||
is_circle,
|
||||
pin.kind == "likes",
|
||||
is_likes_art,
|
||||
);
|
||||
|
||||
// Hover Play/Pause overlay on ALL pinned items (playlists, albums, favorites, artists & waves!)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue