refactor(slint): one shared TrackRow + TrackItem across all surfaces
Collapses the three near-identical track rows (AlbumView's inline
TrackRow, ArtistPage's inline TrackRow with multi-select, and the
shared SearchTrackRow) into a single primitives/TrackRow driven by
flags, backed by one TrackItem (superset). Foundation for the
upcoming playlist module, which renders the artwork variant heavily.
- New primitives/TrackRow.slint with: show-artwork (cover+number vs
number cell), show-album, show-favorite, show-download,
multi-select-mode (selection checkbox). One media-action wires
play / play-next / queue / favorite / download / toggle-select +
the TrackContextMenu.
- TrackItem is the unified model (superset of the old AlbumTrackItem
+ SearchTrackItem: number, album, selected, artwork all present;
unused fields stay empty per surface).
- Migrated AlbumView (show-artwork:false, show-download:true),
ArtistPage Popular (show-artwork:false, multi-select-mode),
Search, Favorites, Mix (show-artwork:true, +album/+favorite).
Deleted SearchTrackRow.slint and both inline TrackRows.
- Rust: AlbumTrackItem + SearchTrackItem -> TrackItem across
album/artist/search/favorites/mix/main; search's internal row
struct renamed TrackRow -> TrackRowData to free the TrackRow name
for the Slint component. 46 tests pass.
cc
This commit is contained in:
14 files changed
+207
-464
No files matched your search
@@ -1,7 +1,7 @@
|
||||
// Library > Favorites — the user's saved tracks / albums / artists /
|
||||
// playlists / labels. Mirrors Tauri's FavoritesView.svelte core: a
|
||||
// tab bar over per-tab content. Tracks reuse the shared
|
||||
// SearchTrackRow, albums the Discover AlbumCard, artists a round-
|
||||
// TrackRow, albums the Discover AlbumCard, artists a round-
|
||||
// portrait grid. Playlists + Labels are stubbed pending their
|
||||
// backing views.
|
||||
|
||||
@@ -12,13 +12,13 @@ import {
|
||||
FavoritesState,
|
||||
FavoritesActions,
|
||||
AlbumCardItem,
|
||||
SearchTrackItem,
|
||||
TrackItem,
|
||||
FavoriteArtistItem,
|
||||
FavoritePlaylistItem,
|
||||
FavoriteLabelItem,
|
||||
} from "../state.slint";
|
||||
import { AlbumCard } from "../discover/AlbumCard.slint";
|
||||
import { SearchTrackRow } from "../search/SearchTrackRow.slint";
|
||||
import { TrackRow } from "../primitives/TrackRow.slint";
|
||||
import { QbzIcon } from "../primitives/QbzIcon.slint";
|
||||
import { LoadingSpinner } from "../primitives/LoadingSpinner.slint";
|
||||
|
||||
@@ -323,7 +323,7 @@ export component FavoritesView inherits Rectangle {
|
||||
color: Theme.text-muted;
|
||||
font-size: Typography.body;
|
||||
}
|
||||
for track[i] in FavoritesState.tracks: SearchTrackRow {
|
||||
for track[i] in FavoritesState.tracks: TrackRow {
|
||||
track: track;
|
||||
index: i;
|
||||
show-artwork: true;
|
||||
|
||||
Reference in new issue
Block a user