first commit

This commit is contained in:
marwy 2026-11-27 13:16:36 +03:00
commit a408df2a76
218 changed files with 52376 additions and 0 deletions

808
src/views/collection.rs Normal file
View file

@ -0,0 +1,808 @@
use crate::api::models::Track;
use crate::app::state::{AppAction, AppState, CollectionTab, Route};
use crate::covers::CoverCache;
use crate::engine::input::WidgetId;
use crate::engine::scroll::visible_row_range;
use crate::engine::text::{TextAlign, TextStyle};
use crate::engine::theme::{YmPalette, TRACK_ROW_HEIGHT};
use crate::engine::types::{Color, CursorKind, Pos2, Rect, Vec2};
use crate::engine::widgets::{
draw_cover_art, icon_button, media_card, secondary_pill_button, track_row, yellow_pill_button,
TrackRowAction, TrackRowOptions,
};
use crate::engine::UiContext;
use crate::icons::Icon;
use crate::views::overlays::{EntityContextMenuState, ShellUiState};
/// Exact Yandex Music Desktop 5.129.0 Collection Page (`pages_api_spec.md` §5):
/// All 7 original tabs:
/// 1. Любимые треки (My Favorites)
/// 2. Плейлисты (with "+ Создать плейлист" card/button + Rename & Delete controls!)
/// 3. Альбомы (Liked albums grid)
/// 4. Исполнители (Liked artists circular grid)
/// 5. Подкасты и книги (Bookshelf / Podcasts grid)
/// 6. Скачанное (Offline downloaded tracks with play & delete from device)
/// 7. История (Listening history)
pub fn render_collection(
ctx: &mut UiContext,
pal: &YmPalette,
covers: &mut CoverCache,
app: &mut AppState,
shell: &mut ShellUiState,
rect: Rect,
actions: &mut Vec<AppAction>,
) {
let t = app.i18n();
let ru = t.is_ru();
let is_playing = app.is_audio_playing();
let current_track_id = app.current_track().map(|tr| tr.id.clone());
let scroll_id = WidgetId::new("collection_scroll");
let scroll_y = ctx.begin_scroll_v(scroll_id, rect, 0.0);
// `views/mod.rs` already insets `inner_r` by (25, 13, 25, 0)
let x = rect.left();
let avail_w = (rect.width() - 6.0).max(320.0);
let mut y = rect.top() + 8.0 - scroll_y;
// Page Heading
ctx.draw_text_ellipsis(
t.collection(),
TextStyle::headline(34.0, pal.text_bright),
Rect::from_xywh(x, y, avail_w, 42.0),
TextAlign::Left,
);
y += 58.0;
// Signature "Мне нравится" / "My Favorites" Hero Banner Card (theme-aware!)
let hero_r = Rect::from_xywh(x, y, avail_w, 120.0);
let hero_resp = ctx.interact(WidgetId::new("col_fav_hero"), hero_r);
let hero_bg = if pal.is_dark {
if hero_resp.hovered {
Color::rgb(0x2A, 0x24, 0x17)
} else {
Color::rgb(0x22, 0x1D, 0x12)
}
} else if hero_resp.hovered {
Color::rgb(0xFF, 0xF2, 0xBC)
} else {
Color::rgb(0xFF, 0xF8, 0xD6)
};
ctx.dl()
.push_rect_bordered(hero_r, 16.0, hero_bg, 1.0, pal.border_subtle);
let cov_r = Rect::from_xywh(hero_r.left() + 18.0, hero_r.center_y() - 42.0, 84.0, 84.0);
draw_cover_art(ctx, pal, covers, cov_r, None, "likes", 12.0, false, true);
let fav_title = t.liked_playlist();
ctx.draw_text_ellipsis(
fav_title,
TextStyle::headline(26.0, pal.text_bright),
Rect::from_xywh(cov_r.right() + 20.0, hero_r.top() + 28.0, avail_w - 280.0, 32.0),
TextAlign::Left,
);
ctx.draw_text_ellipsis(
&t.count_tracks(app.liked_tracks.len()),
TextStyle::regular(14.0, pal.text_secondary),
Rect::from_xywh(cov_r.right() + 20.0, hero_r.top() + 66.0, avail_w - 280.0, 22.0),
TextAlign::Left,
);
let likes_playing = app.is_context_playing("likes");
let play_btn_label = if likes_playing { t.pause() } else { t.listen() };
let play_text_w = ctx
.measure_text(play_btn_label, TextStyle::medium(14.0, pal.on_yellow), None)
.x;
let play_btn_w = (play_text_w + 28.0 + 36.0).max(100.0).ceil();
let play_btn_r = Rect::from_xywh(
hero_r.right() - play_btn_w - 24.0,
hero_r.center_y() - 21.0,
play_btn_w,
42.0,
);
let play_resp = crate::engine::widgets::yellow_pill_button_in(
ctx,
pal,
WidgetId::new("col_fav_play"),
play_btn_r,
Some(if likes_playing {
Icon::PauseXxs
} else {
Icon::PlayXxs
}),
play_btn_label,
app.liked_tracks.is_empty(),
);
if play_resp.clicked && !app.liked_tracks.is_empty() {
actions.push(AppAction::ToggleContextPlay {
tracks: app.liked_tracks.clone(),
context_name: fav_title.into(),
context_key: "likes".into(),
is_vibe: false,
});
} else if hero_resp.clicked {
actions.push(AppAction::Navigate(Route::LikedTracks));
}
if hero_resp.hovered {
ctx.set_cursor(CursorKind::Pointer);
}
y += 120.0 + 20.0;
// All 7 Original Collection Tabs (horizontal scrollable pill bar!)
let tabs_vp = Rect::from_xywh(x, y, avail_w, 42.0);
let tabs_h_id = WidgetId::new("col_tabs_hscroll");
let tabs_sx = ctx.begin_scroll_h(tabs_h_id, tabs_vp, 0.0);
let mut tx = x - tabs_sx;
let all_tabs = [
(CollectionTab::Tracks, t.liked_tracks_tab()),
(CollectionTab::Playlists, t.playlists()),
(CollectionTab::Albums, t.albums()),
(CollectionTab::Artists, t.artists()),
(CollectionTab::PodcastsAndBooks, t.podcasts_and_books()),
(CollectionTab::Downloaded, t.downloaded()),
(CollectionTab::History, t.history()),
];
for (tab_kind, label) in all_tabs {
let (resp, r) = secondary_pill_button(
ctx,
pal,
WidgetId::from_pair("col_tab", tab_kind as u8),
Pos2::new(tx, y),
None,
label,
38.0,
app.collection_tab == tab_kind,
);
if resp.clicked {
app.collection_tab = tab_kind;
}
tx = r.right() + 8.0;
}
let tabs_total_w = (tx + tabs_sx) - x;
ctx.end_scroll_h(tabs_h_id, pal, tabs_total_w, false);
y += 56.0;
// -------------------------------------------------------------------------
// TAB BODY
// -------------------------------------------------------------------------
match app.collection_tab {
CollectionTab::Tracks => {
if app.liked_tracks.is_empty() {
ctx.draw_text_wrapped(
if ru {
"Ставьте лайки трекам или войдите в аккаунт Яндекс Музыки — они появятся здесь."
} else {
"Like tracks or sign in to Yandex Music — they will appear here."
},
TextStyle::regular(14.0, pal.text_secondary),
Rect::from_xywh(x, y, avail_w, 44.0),
Some(2),
TextAlign::Left,
);
y += 48.0;
} else {
let tracks = app.liked_tracks.clone();
y = render_virtual_track_list(
ctx,
pal,
covers,
app,
shell,
rect,
x,
y,
avail_w,
&tracks,
"col_liked",
fav_title,
"likes",
current_track_id.as_deref(),
is_playing,
actions,
);
}
}
CollectionTab::Playlists => {
let gap = 16.0;
let cols = ((avail_w + gap) / 184.0).floor().clamp(2.0, 6.0) as usize;
let card_w = ((avail_w - gap * (cols as f32 - 1.0)) / cols as f32).max(132.0);
let card_h = card_w + 62.0;
// Total slots = 1 ("+ Create playlist" card) + user_playlists.len()
let playlists = app.user_playlists.clone();
let my_uid = app.account.as_ref().map(|a| a.uid.to_string());
// Slot 0: "+ Создать плейлист" visual card
{
let cr = Rect::from_xywh(x, y, card_w, card_h);
let cov_r = Rect::from_xywh(cr.left(), cr.top(), card_w, card_w);
let resp = ctx.interact(WidgetId::new("col_create_pl_card"), cr);
ctx.dl().push_rect_bordered(
cov_r,
8.0,
if resp.hovered {
pal.surface_hover
} else {
pal.surface_secondary
},
1.0,
pal.border_control,
);
ctx.draw_icon(
Icon::AddXxs,
Rect::from_center_size(cov_r.center(), Vec2::splat(36.0)),
if resp.hovered {
pal.text_bright
} else {
pal.text_secondary
},
);
ctx.draw_text_ellipsis(
t.create_playlist(),
TextStyle::medium(13.5, pal.text_primary),
Rect::from_xywh(cr.left(), cov_r.bottom() + 8.0, card_w, 20.0),
TextAlign::Left,
);
if resp.hovered {
ctx.set_cursor(CursorKind::Pointer);
}
if resp.clicked {
actions.push(AppAction::OpenCreatePlaylistModal {
initial_track: None,
});
}
}
for (i, pl) in playlists.iter().enumerate() {
let slot = i + 1;
let col = slot % cols;
let row = slot / cols;
let cr = Rect::from_xywh(
x + col as f32 * (card_w + gap),
y + row as f32 * (card_h + 16.0),
card_w,
card_h,
);
if cr.bottom() < rect.top() - 40.0 || cr.top() > rect.bottom() + 40.0 {
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 m = media_card(
ctx,
pal,
covers,
wid,
Rect::from_xywh(cr.left(), cr.top(), card_w, card_w + 48.0),
&pl.title,
&sub,
pl.cover_uri.as_deref(),
&format!("upl_{}_{}", pl.owner_uid, pl.kind),
false,
false,
);
// Own playlists (not Liked kind=3) get quick Rename & Delete action icons on hover!
let is_own = pl.kind != "3"
&& (pl.owner_uid == "local"
|| my_uid.as_deref() == Some(pl.owner_uid.as_str()));
let card_hovered = ctx.is_hovered(cr);
if is_own && card_hovered {
let ren_r = Rect::from_xywh(cr.right() - 62.0, cr.top() + 8.0, 26.0, 26.0);
let del_r = Rect::from_xywh(cr.right() - 32.0, cr.top() + 8.0, 26.0, 26.0);
ctx.dl().push_circle(ren_r.center(), 13.0, pal.bg_overlay);
ctx.dl().push_circle(del_r.center(), 13.0, pal.bg_overlay);
let ren_resp = icon_button(
ctx,
wid.with("rename"),
ren_r,
Icon::EditXxs,
15.0,
Color::WHITE,
pal.yellow,
Color::TRANSPARENT,
false,
t.rename(),
);
let del_resp = icon_button(
ctx,
wid.with("delete"),
del_r,
Icon::BucketXxs,
15.0,
Color::WHITE,
pal.error,
Color::TRANSPARENT,
false,
t.delete_playlist(),
);
if ren_resp.clicked {
actions.push(AppAction::OpenRenamePlaylistModal {
owner_uid: pl.owner_uid.clone(),
kind: pl.kind.clone(),
current_title: pl.title.clone(),
});
continue;
}
if del_resp.clicked {
if let Ok(uid) = pl.owner_uid.parse::<u64>() {
shell.confirm_delete_playlist =
Some((uid, pl.kind.clone(), pl.title.clone()));
} else {
actions.push(AppAction::DeletePlaylist {
owner_uid: pl.owner_uid.clone(),
kind: pl.kind.clone(),
});
}
continue;
}
}
if let Some(pos) = m.right_clicked_pos {
shell.open_entity_menu(EntityContextMenuState {
kind: "playlist".into(),
id: format!("{}:{}", pl.owner_uid, pl.kind),
title: pl.title.clone(),
subtitle: t.playlist().into(),
cover_uri: pl.cover_uri.clone(),
owner_uid: Some(pl.owner_uid.clone()),
is_own_playlist: is_own,
tracks: Vec::new(),
anchor: pos,
share_url: format!(
"https://music.yandex.ru/users/{}/playlists/{}",
pl.owner_uid, pl.kind
),
});
} else if m.play_clicked {
actions.push(AppAction::PlayPlaylist {
owner_uid: pl.owner_uid.clone(),
kind: pl.kind.clone(),
title: pl.title.clone(),
});
} else if m.clicked {
actions.push(AppAction::Navigate(Route::Playlist {
owner_uid: pl.owner_uid.clone(),
kind: pl.kind.clone(),
title: pl.title.clone(),
}));
}
}
let total_slots = playlists.len() + 1;
let rows = total_slots.div_ceil(cols);
y += rows as f32 * (card_h + 16.0) + 12.0;
}
CollectionTab::Albums => {
let albums = if !app.liked_albums.is_empty() {
app.liked_albums.clone()
} else {
Vec::new()
};
if albums.is_empty() {
ctx.draw_text_ellipsis(
if ru {
"Здесь появятся ваши любимые альбомы."
} else {
"Your favorite albums will appear here."
},
TextStyle::regular(14.0, pal.text_secondary),
Rect::from_xywh(x, y, avail_w, 24.0),
TextAlign::Left,
);
y += 32.0;
} else {
let gap = 16.0;
let cols = ((avail_w + gap) / 184.0).floor().clamp(2.0, 6.0) as usize;
let card_w = ((avail_w - gap * (cols as f32 - 1.0)) / cols as f32).max(132.0);
let card_h = card_w + 54.0;
for (idx, alb) in albums.iter().enumerate() {
let col = idx % cols;
let row = idx / cols;
let cr = Rect::from_xywh(
x + col as f32 * (card_w + gap),
y + row as f32 * (card_h + 16.0),
card_w,
card_h,
);
if cr.bottom() >= rect.top() - 40.0 && cr.top() <= rect.bottom() + 40.0 {
let sub = alb
.artists
.first()
.map(|a| a.name.as_str())
.unwrap_or(t.album());
let m = media_card(
ctx,
pal,
covers,
WidgetId::from_pair("col_alb", &alb.id),
cr,
&alb.title,
sub,
alb.cover_uri.as_deref(),
&format!("alb_{}", alb.id),
false,
false,
);
if let Some(pos) = m.right_clicked_pos {
shell.open_entity_menu(EntityContextMenuState {
kind: "album".into(),
id: alb.id.clone(),
title: alb.title.clone(),
subtitle: t.album().into(),
cover_uri: alb.cover_uri.clone(),
owner_uid: None,
is_own_playlist: false,
tracks: Vec::new(),
anchor: pos,
share_url: format!("https://music.yandex.ru/album/{}", alb.id),
});
} else if m.play_clicked {
actions.push(AppAction::PlayAlbum {
id: alb.id.clone(),
title: alb.title.clone(),
});
} else if m.clicked {
actions.push(AppAction::Navigate(Route::Album {
id: alb.id.clone(),
title: alb.title.clone(),
}));
}
}
}
let rows = albums.len().div_ceil(cols);
y += rows as f32 * (card_h + 16.0) + 12.0;
}
}
CollectionTab::Artists => {
if app.liked_artists.is_empty() {
ctx.draw_text_ellipsis(
if ru {
"Здесь появятся ваши любимые исполнители."
} else {
"Your favorite artists will appear here."
},
TextStyle::regular(14.0, pal.text_secondary),
Rect::from_xywh(x, y, avail_w, 24.0),
TextAlign::Left,
);
y += 32.0;
} else {
let artists = app.liked_artists.clone();
let gap = 16.0;
let cols = ((avail_w + gap) / 176.0).floor().clamp(2.0, 6.0) as usize;
let card_w = ((avail_w - gap * (cols as f32 - 1.0)) / cols as f32).max(120.0);
let card_h = card_w + 52.0;
for (idx, art) in artists.iter().enumerate() {
let col = idx % cols;
let row = idx / cols;
let cr = Rect::from_xywh(
x + col as f32 * (card_w + gap),
y + row as f32 * (card_h + 16.0),
card_w,
card_h,
);
if cr.bottom() >= rect.top() - 40.0 && cr.top() <= rect.bottom() + 40.0 {
let m = media_card(
ctx,
pal,
covers,
WidgetId::from_pair("col_art", &art.id),
cr,
&art.name,
t.artist(),
art.cover_uri.as_deref(),
&format!("art_{}", art.id),
true,
false,
);
if let Some(pos) = m.right_clicked_pos {
shell.open_entity_menu(EntityContextMenuState {
kind: "artist".into(),
id: art.id.clone(),
title: art.name.clone(),
subtitle: t.artist().into(),
cover_uri: art.cover_uri.clone(),
owner_uid: None,
is_own_playlist: false,
tracks: Vec::new(),
anchor: pos,
share_url: format!("https://music.yandex.ru/artist/{}", art.id),
});
} else if m.play_clicked {
actions.push(AppAction::PlayArtist {
id: art.id.clone(),
name: art.name.clone(),
});
} else if m.clicked {
actions.push(AppAction::Navigate(Route::Artist {
id: art.id.clone(),
name: art.name.clone(),
}));
}
}
}
let rows = artists.len().div_ceil(cols);
y += rows as f32 * (card_h + 16.0) + 12.0;
}
}
CollectionTab::PodcastsAndBooks => {
let items = if !app.bookshelf_items.is_empty() {
app.bookshelf_items.clone()
} else {
app.landing.podcasts.clone()
};
if items.is_empty() {
ctx.draw_text_ellipsis(
if ru {
"Здесь появятся ваши подкасты и аудиокниги."
} else {
"Your saved podcasts and audiobooks will appear here."
},
TextStyle::regular(14.0, pal.text_secondary),
Rect::from_xywh(x, y, avail_w, 24.0),
TextAlign::Left,
);
y += 32.0;
} else {
let gap = 16.0;
let cols = ((avail_w + gap) / 184.0).floor().clamp(2.0, 6.0) as usize;
let card_w = ((avail_w - gap * (cols as f32 - 1.0)) / cols as f32).max(132.0);
let card_h = card_w + 54.0;
for (idx, pod) in items.iter().enumerate() {
let col = idx % cols;
let row = idx / cols;
let cr = Rect::from_xywh(
x + col as f32 * (card_w + gap),
y + row as f32 * (card_h + 16.0),
card_w,
card_h,
);
if cr.bottom() >= rect.top() - 40.0 && cr.top() <= rect.bottom() + 40.0 {
let sub = pod
.artists
.first()
.map(|a| a.name.as_str())
.unwrap_or(if ru { "Подкаст" } else { "Podcast" });
let m = media_card(
ctx,
pal,
covers,
WidgetId::from_pair("col_pod", &pod.id),
cr,
&pod.title,
sub,
pod.cover_uri.as_deref(),
&format!("pod_{}", pod.id),
false,
false,
);
if let Some(pos) = m.right_clicked_pos {
shell.open_entity_menu(EntityContextMenuState {
kind: "album".into(),
id: pod.id.clone(),
title: pod.title.clone(),
subtitle: sub.to_string(),
cover_uri: pod.cover_uri.clone(),
owner_uid: None,
is_own_playlist: false,
tracks: Vec::new(),
anchor: pos,
share_url: format!("https://music.yandex.ru/album/{}", pod.id),
});
} else if m.play_clicked {
actions.push(AppAction::PlayAlbum {
id: pod.id.clone(),
title: pod.title.clone(),
});
} else if m.clicked {
actions.push(AppAction::Navigate(Route::Album {
id: pod.id.clone(),
title: pod.title.clone(),
}));
}
}
}
let rows = items.len().div_ceil(cols);
y += rows as f32 * (card_h + 16.0) + 12.0;
}
}
CollectionTab::Downloaded => {
let dl_tracks = app.config.downloaded_tracks.clone();
if dl_tracks.is_empty() {
ctx.draw_text_wrapped(
if ru {
"Скачанные треки появятся здесь — их можно слушать без интернета."
} else {
"Downloaded tracks will appear here for offline playback."
},
TextStyle::regular(14.0, pal.text_secondary),
Rect::from_xywh(x, y, avail_w, 44.0),
Some(2),
TextAlign::Left,
);
y += 48.0;
} else {
// Header bar with Play Offline + Clear all downloaded
let dl_playing = app.is_context_playing("downloads");
let (play_r, pr) = yellow_pill_button(
ctx,
pal,
WidgetId::new("col_dl_play"),
Pos2::new(x, y),
Some(if dl_playing {
Icon::PauseXxs
} else {
Icon::PlayXxs
}),
if dl_playing { t.pause() } else { t.listen() },
38.0,
false,
);
if play_r.clicked {
actions.push(AppAction::ToggleContextPlay {
tracks: dl_tracks.clone(),
context_name: t.downloaded_tracks().into(),
context_key: "downloads".into(),
is_vibe: false,
});
}
let (del_all, _) = secondary_pill_button(
ctx,
pal,
WidgetId::new("col_dl_clear"),
Pos2::new(pr.right() + 10.0, y),
Some(Icon::BucketXxs),
t.delete_from_device(),
38.0,
false,
);
if del_all.clicked {
let ids: Vec<String> = dl_tracks.iter().map(|tr| tr.id.clone()).collect();
actions.push(AppAction::RemoveDownloadedTracks(ids));
}
y += 52.0;
y = render_virtual_track_list(
ctx,
pal,
covers,
app,
shell,
rect,
x,
y,
avail_w,
&dl_tracks,
"col_dl",
t.downloaded_tracks(),
"downloads",
current_track_id.as_deref(),
is_playing,
actions,
);
}
}
CollectionTab::History => {
if app.play_history.is_empty() {
ctx.draw_text_ellipsis(
if ru {
"Здесь будут треки, которые вы недавно слушали."
} else {
"Tracks you recently listened to will appear here."
},
TextStyle::regular(14.0, pal.text_secondary),
Rect::from_xywh(x, y, avail_w, 24.0),
TextAlign::Left,
);
y += 32.0;
} else {
let hist = app.play_history.clone();
y = render_virtual_track_list(
ctx,
pal,
covers,
app,
shell,
rect,
x,
y,
avail_w,
&hist,
"col_hist",
t.history(),
"history",
current_track_id.as_deref(),
is_playing,
actions,
);
}
}
}
y += 24.0;
let total_h = y - (rect.top() - scroll_y);
ctx.end_scroll_v(scroll_id, pal, total_h, true);
}
#[allow(clippy::too_many_arguments)]
fn render_virtual_track_list(
ctx: &mut UiContext,
pal: &YmPalette,
covers: &mut CoverCache,
app: &AppState,
shell: &mut ShellUiState,
viewport: Rect,
x: f32,
list_top_y: f32,
avail_w: f32,
tracks: &[Track],
salt: &str,
context_name: &str,
context_key: &str,
current_track_id: Option<&str>,
is_playing: bool,
actions: &mut Vec<AppAction>,
) -> f32 {
let t = app.i18n();
let range = visible_row_range(viewport, list_top_y, TRACK_ROW_HEIGHT, tracks.len(), 2);
for idx in range {
let tr = &tracks[idx];
let row_y = list_top_y + idx as f32 * TRACK_ROW_HEIGHT;
let row_r = Rect::from_xywh(x, row_y, avail_w, TRACK_ROW_HEIGHT);
let is_curr = current_track_id == Some(tr.id.as_str());
match track_row(
ctx,
pal,
covers,
WidgetId::from_pair(salt, idx),
row_r,
tr,
TrackRowOptions {
index: Some(idx),
show_chart_rank: false,
show_cover: true,
is_current: is_curr,
is_playing: is_curr && is_playing,
is_liked: app.liked_ids.contains(&tr.id),
is_disliked: app.disliked_ids.contains(&tr.id),
is_downloaded: app.is_track_downloaded(&tr.id),
menu_open: shell.is_track_menu_open(&tr.id),
},
) {
TrackRowAction::Play => {
actions.push(AppAction::PlayTracks {
tracks: tracks.to_vec(),
start_index: idx,
context_name: context_name.to_string(),
context_key: context_key.to_string(),
is_vibe: false,
});
}
TrackRowAction::ToggleLike => actions.push(AppAction::ToggleLike(tr.clone())),
TrackRowAction::ToggleDislike => actions.push(AppAction::ToggleDislike(tr.clone())),
TrackRowAction::OpenArtist(id, name) => {
actions.push(AppAction::Navigate(Route::Artist { id, name }));
}
TrackRowAction::OpenAlbum(id) => {
actions.push(AppAction::Navigate(Route::Album {
id,
title: tr
.album_title
.clone()
.unwrap_or_else(|| t.album().into()),
}));
}
TrackRowAction::OpenContextMenu(pos) => {
shell.open_track_menu(tr.clone(), pos);
}
TrackRowAction::None => {}
}
}
list_top_y + tracks.len() as f32 * TRACK_ROW_HEIGHT
}