Files
qbz/crates/qbz-ui/ui/primitives/DiscContextMenu.slint
T
vicrodh c8ef2a1b1d refactor(slint): split qbz-slint into qbz-ui lib + qbz bin; reclaim qbz binary
Slint cannot split the .slint compilation across crates, but a Slint LIBRARY
crate exposes its generated Rust types to dependent crates (verified with a
minimal proof). So:

- NEW crate `qbz-ui` (lib): owns the whole .slint tree + build.rs + bundled
  translations; `slint::include_modules!()` + the generated types (AppWindow,
  MiniPlayerWindow, all globals/structs) are re-exported. Translation domain is
  now `qbz-ui` (the .po files renamed accordingly).
- `qbz-slint` (bin) -> renamed to `qbz` (package + `[[bin]] name = "qbz"`),
  reclaiming the binary name from the retired Tauri app. It depends on `qbz-ui`
  and does `pub use qbz_ui::*;` so existing `crate::AppWindow` / `crate::*State`
  references resolve unchanged.

This splits the single ~20 GB rustc into two crates (UI/codegen vs the 75k LOC
of logic) — the foundation for lower build peak, incremental caching, and the
upcoming per-feature crate extraction.

Also fixed for the move: qbz-i18n bundled-.po include paths, the font/WGSL
`include_bytes!`/`include_str!` paths (-> ../../qbz-ui/ui/), workspace members,
dev scripts (`-p qbz`), and the CI workflows. `cargo check -p qbz` is green.

cc
2026-06-25 17:51:09 -06:00

60 lines
2.1 KiB
Plaintext

// Per-disc "more" (⋯) context menu — opened from a "Disc N" separator in the
// album track list (Qobuz AlbumPageView + LocalAlbumView). NEW feature: Tauri
// has no per-disc menu. Each action is scoped to that disc's tracks only; the
// whole-album header buttons keep their own behavior.
//
// Mirrors AlbumContextMenu's structure (a PopupWindow hosting a ContextMenu +
// ContextMenuItem rows) so it reads like every other ⋯ menu. The `disc`
// property identifies which disc the four actions operate on.
//
// Play all -> disc-action(disc, "play")
// Shuffle -> disc-action(disc, "shuffle")
// --
// Add to queue -> disc-action(disc, "queue")
// Play next -> disc-action(disc, "play-next")
import { Theme } from "../foundation/semantic-colors.slint";
import { ContextMenu } from "ContextMenu.slint";
import { ContextMenuItem } from "ContextMenuItem.slint";
export component DiscContextMenu inherits PopupWindow {
in property <int> disc;
callback disc-action(int, string);
width: 200px;
// 4 rows x 33px + 1 separator x 1px + ContextMenu's 5/5 padding.
height: 4 * 33px + 1 * 1px + 10px;
ContextMenu {
ContextMenuItem {
icon: @image-url("../assets/icons/play-fill.svg");
label: @tr("Play all");
clicked => {
root.disc-action(root.disc, "play");
}
}
ContextMenuItem {
icon: @image-url("../assets/icons/shuffle.svg");
label: @tr("Shuffle");
clicked => {
root.disc-action(root.disc, "shuffle");
}
}
Rectangle { height: 1px; background: Theme.border-subtle; }
ContextMenuItem {
icon: @image-url("../assets/icons/list-end.svg");
label: @tr("Add to queue");
clicked => {
root.disc-action(root.disc, "queue");
}
}
ContextMenuItem {
icon: @image-url("../assets/icons/list-plus.svg");
label: @tr("Play next");
clicked => {
root.disc-action(root.disc, "play-next");
}
}
}
}