Files
qbz/crates/qbz-ui/ui/miniplayer/MiniShell.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

66 lines
2.7 KiB
Plaintext

// Miniplayer SHELL — the rounded card: mounts exactly one surface (or none for
// micro, where the footer is the whole content) plus the footer. 1:1 with
// Tauri MiniPlayerShell.svelte. Whole-window hover (capsule reveal) is fed from
// the mini window's winit pointer events into MiniPlayerState.window-hovered.
import { Theme } from "../foundation/semantic-colors.slint";
import { ImmersiveState, MiniPlayerState, NowPlayingState } from "../state.slint";
import { ImmersiveAtmosphere } from "../immersive/ImmersiveAtmosphere.slint";
import { MiniCompactSurface } from "MiniCompactSurface.slint";
import { MiniArtworkSurface } from "MiniArtworkSurface.slint";
import { MiniQueueSurface } from "MiniQueueSurface.slint";
import { MiniLyricsSurface } from "MiniLyricsSurface.slint";
import { MiniFooter } from "MiniFooter.slint";
export component MiniShell inherits Rectangle {
property <int> surface: MiniPlayerState.surface;
// 0 micro -> footer mode 2; 1 compact -> 1; expanded (2/3/4) -> 0.
property <int> footer-mode: root.surface == 0 ? 2 : (root.surface == 1 ? 1 : 0);
background: MiniPlayerState.background-blur ? #050506 : Theme.surface-main; // --bg-primary
border-width: 1px;
border-color: Theme.alpha-10;
border-radius: root.surface <= 1 ? 9px : 10px; // micro/compact 9, else 10
clip: true;
if MiniPlayerState.background-blur && NowPlayingState.has-track: ImmersiveAtmosphere {
width: 100%;
height: 100%;
source-image: ImmersiveState.bg-image;
fallback-image: NowPlayingState.artwork-large.width > 0
? NowPlayingState.artwork-large
: NowPlayingState.artwork;
animated: false;
dim: 0.54;
base-opacity: 0.72;
warp-opacity: 0.20;
}
if MiniPlayerState.background-blur: Rectangle {
background: #050506bf;
}
VerticalLayout {
width: 100%;
height: 100%;
// Surface area (everything except micro).
if root.surface != 0: Rectangle {
vertical-stretch: 1;
clip: true;
if root.surface == 1: MiniCompactSurface { width: 100%; height: 100%; }
if root.surface == 2: MiniArtworkSurface { width: 100%; height: 100%; }
if root.surface == 3: MiniQueueSurface { width: 100%; height: 100%; }
if root.surface == 4: MiniLyricsSurface { width: 100%; height: 100%; }
}
// Footer. In micro it fills the whole card (stretch); otherwise it has a
// fixed per-mode height (a Rectangle doesn't size to its child layout).
MiniFooter {
mode: root.footer-mode;
vertical-stretch: root.surface == 0 ? 1 : 0;
height: root.surface == 1 ? 64px : (root.surface == 0 ? 50px : 80px);
}
}
}