Clicking an album card opens the album detail view: a back button, the album header (224px artwork, title, artist, and info line — year, label, genre, track count, duration — plus play / shuffle / favorite / more action buttons), and the track list with a column header (#, title, artist, duration, quality). - album.rs: fetches the album via QbzCore::get_album, maps it (info line, per-track quality tier, durations) onto the AlbumState global, and loads the header artwork through the shared image cache. - AlbumPageView.slint, with NavState driving the shell content region between Home and the album page. - Album clicks bubble AlbumCard -> Carousel -> HomeView -> AppShell -> AppWindow -> main; the back button returns to Home. cc
54 lines
1.5 KiB
Plaintext
54 lines
1.5 KiB
Plaintext
// Shared UI state — structs and globals the Rust controllers populate.
|
|
//
|
|
// The Rust side builds these models on a worker thread, then sets them
|
|
// on the global from the Slint event loop (see src/home.rs, src/main.rs).
|
|
|
|
export struct AlbumCardItem {
|
|
id: string,
|
|
title: string,
|
|
artist: string,
|
|
genre: string, // shown in the hover overlay
|
|
year: string, // shown in the hover overlay
|
|
quality-tier: string, // "hires" | "cd" | "" — drives the badge icon
|
|
ribbon: string,
|
|
ribbon-kind: string, // "press" | "qobuzissime" | "albumOfTheWeek" | ""
|
|
artwork-url: string,
|
|
artwork: image, // empty until the artwork pipeline resolves it
|
|
}
|
|
|
|
export struct DiscoverSection {
|
|
title: string,
|
|
albums: [AlbumCardItem],
|
|
}
|
|
|
|
// Discover / Home screen state.
|
|
export global HomeState {
|
|
in property <[DiscoverSection]> sections: [];
|
|
in property <bool> loading: false;
|
|
}
|
|
|
|
export struct AlbumTrackItem {
|
|
number: string,
|
|
title: string,
|
|
artist: string,
|
|
duration: string,
|
|
quality-tier: string,
|
|
explicit: bool,
|
|
}
|
|
|
|
// Album detail screen state.
|
|
export global AlbumState {
|
|
in property <string> title;
|
|
in property <string> artist;
|
|
in property <string> info-line;
|
|
in property <string> quality-tier;
|
|
in property <image> artwork;
|
|
in property <[AlbumTrackItem]> tracks: [];
|
|
in property <bool> loading: false;
|
|
}
|
|
|
|
// Which content view the shell shows.
|
|
export global NavState {
|
|
in-out property <bool> showing-album: false;
|
|
}
|