// Album header "more" (⋯) context menu — ported 1:1 from the Tauri // `AlbumMenu` (src/lib/components/AlbumMenu.svelte) as wired by the album // detail header. Tauri nests Share/Download as submenus; we render them // FLAT (the same cosmetic-flat convention as TrackContextMenu) with group // separators matching Tauri's menu grouping. // // Item -> media-action("album", , ) mapping: // Play next -> "play-next" // Add to queue -> "queue" // -- // Add to playlist -> "add-to-playlist" // Add to Mixtape/Coll. -> "add-to-mixtape" // -- // Share Qobuz link -> "share-qobuz" // Share Album.link -> "share-songlink" // -- // Make available offline -> "cache" (album NOT fully cached) // Refresh offline copy -> "recache" (album fully cached) // // Tauri's onMakeOffline ("download.makeAvailable") item is NOT passed by // the album detail header, so it is intentionally absent (1:1). The last // row swaps Make-available-offline <-> Refresh-offline-copy on // `fully-cached`, the flat form of Tauri's isAlbumFullyDownloaded submenu // (which only carries Refresh — no Remove at album level). import { Theme } from "../foundation/semantic-colors.slint"; import { ContextMenu } from "ContextMenu.slint"; import { ContextMenuItem } from "ContextMenuItem.slint"; export component AlbumContextMenu inherits PopupWindow { in property album-id; // Every track of the album already has a ready offline copy. in property fully-cached: false; callback media-action(string, string, string); width: 224px; // 7 rows x 33px + 3 separators x 1px + ContextMenu's 5/5 padding. The // offline row swaps label/action on `fully-cached` — count is constant. height: 7 * 33px + 3 * 1px + 10px; ContextMenu { ContextMenuItem { icon: @image-url("../assets/icons/list-plus.svg"); label: @tr("Play next"); clicked => { root.media-action("album", root.album-id, "play-next"); } } ContextMenuItem { icon: @image-url("../assets/icons/list-end.svg"); label: @tr("Add to queue"); clicked => { root.media-action("album", root.album-id, "queue"); } } Rectangle { height: 1px; background: Theme.border-subtle; } ContextMenuItem { icon: @image-url("../assets/icons/list-music.svg"); label: @tr("Add to playlist"); clicked => { root.media-action("album", root.album-id, "add-to-playlist"); } } ContextMenuItem { icon: @image-url("../assets/icons/cassette-tape.svg"); label: @tr("Add to mixtape"); clicked => { root.media-action("album", root.album-id, "add-to-mixtape"); } } Rectangle { height: 1px; background: Theme.border-subtle; } ContextMenuItem { icon: @image-url("../assets/icons/link.svg"); label: @tr("Share Qobuz link"); clicked => { root.media-action("album", root.album-id, "share-qobuz"); } } ContextMenuItem { icon: @image-url("../assets/icons/link.svg"); label: @tr("Share Album.link"); clicked => { root.media-action("album", root.album-id, "share-songlink"); } } Rectangle { height: 1px; background: Theme.border-subtle; } if !root.fully-cached: ContextMenuItem { icon: @image-url("../assets/icons/cloud-download.svg"); label: @tr("Make available offline"); clicked => { root.media-action("album", root.album-id, "cache"); } } if root.fully-cached: ContextMenuItem { icon: @image-url("../assets/icons/refresh-cw.svg"); label: @tr("Refresh offline copy"); clicked => { root.media-action("album", root.album-id, "recache"); } } } }