Files
qbz/crates/qbz-slint/ui/miniplayer/MiniCompactSurface.slint
T
vicrodh c974b8a973 feat(slint): miniplayer — second borderless window with five surfaces
Port the Tauri MiniPlayer to a second Slint MiniPlayerWindow (not an
AppWindow morph). Borderless via the native no-frame property (Slint's
winit adapter re-applies decorations from no-frame on every realization,
so the attributes hook alone was undone); the vendored renderer gives the
transparent rounded floating card. First QBZ surface with no system
titlebar.

State is mirror-driven with no second poll loop: the existing 450ms
playback poll and the 30Hz lyrics tick each fan out one mirror call into
the mini's per-window globals (REQ-1), gating the expensive copies
(artwork / queue / lyric lines) on track-id change. The queue surface owns
a self-contained navigable model (current + full upcoming, not the 40-row
sidebar page), and per-row play routes remote-first and bails before
mutating local (REQ-2). Transport callbacks delegate to the main window's
already-wired remote-first handlers (zero duplication).

Surfaces: micro / compact / artwork / queue / lyrics (reuses
LyricsLinesView + LyricsState). Footer with pending-seek state, transport,
volume popover, and the hover-expand controls capsule (surface tabs +
background-blur toggle + move-drag + close). Optional static
artwork-derived background-blur backdrop. Lifecycle in src/miniplayer.rs
(create-once / enter / exit / close / per-surface geometry persistence /
winit hooks). Menu entry enabled in PlayerBar + PlayerBarSmall.

cc
2026-06-17 18:35:28 -06:00

58 lines
1.9 KiB
Plaintext

// Miniplayer COMPACT surface — a horizontal metadata strip (380x178 window).
// Display only: no controls, no IPC, no marquee (long text ellipsis-truncates).
// 1:1 with Tauri MiniPlayerCompactSurface.svelte.
import { Theme } from "../foundation/semantic-colors.slint";
import { NowPlayingState } from "../state.slint";
import { ExplicitBadge, CoverArt } from "MiniBits.slint";
export component MiniCompactSurface inherits Rectangle {
// Cover fills the available height (minus padding), kept square (1:1).
property <length> art: Math.max(40px, root.height - 24px);
HorizontalLayout {
width: 100%;
height: 100%;
padding: 12px;
spacing: 12px;
alignment: start;
// Square cover, fills height, vertically centered.
CoverArt {
source: NowPlayingState.artwork;
radius: 8px;
width: root.art;
height: root.art;
}
// Title + artist, vertically centered, fills remaining width.
VerticalLayout {
alignment: center;
spacing: 2px;
HorizontalLayout {
spacing: 5px;
Text {
horizontal-stretch: 1;
text: NowPlayingState.has-track ? NowPlayingState.title : @tr("No track playing");
color: Theme.text-primary;
font-size: 13px;
font-weight: 600;
overflow: elide;
vertical-alignment: center;
}
if NowPlayingState.explicit: ExplicitBadge {
horizontal-stretch: 0;
}
}
Text {
text: NowPlayingState.artist != "" ? NowPlayingState.artist : "—";
color: Theme.text-muted;
font-size: 11px;
overflow: elide;
}
}
}
}