Block B2 of the miniplayer/tray contract, and the block that settles the premise the whole port rests on: a second top-level Window in the same QQmlApplicationEngine reads the SAME bridge singletons as the shell. Proven by driving it — a probe window with one Text bound to QbzPlayer.npTitle tracked the main window across a track change with no mirror code. Slint needs ~155 lines of mirroring for this; Qt needs none. qml/miniplayer/ (new, six files) — MiniWindow (frameless, transparent, transientParent null, its own key host and its own onClosing), MiniShell (the card, the artwork backdrop, the surface router), MiniCoverArt and MiniExplicitBadge (the two components MiniBits.slint exports, which cannot share one .qml file), and the compact and artwork surfaces. The card is the window minus a 6 px gutter, its radius is 9 for the condensed surfaces and 10 otherwise, and switching the surface RESIZES THE WINDOW — 540 to 178 and back, driven and measured, not inferred. The backdrop lives inside a masked container. `clip: true` on a rounded Rectangle does NOT round its children on this Qt build — theme/RoundedImage.qml records that as measured fact — so without the mask the scrim and the atmosphere's own opaque root would paint square corners over the card the moment the backdrop is on. That is reachable before its toggle exists, because the pref is co-owned with the shipping Slint app. src/mini_bridge.rs — enter/exit, the mini's own key dispatcher, and toggle(). Re-entering an open mini re-raises it rather than doing nothing, which is what the reference does and what present() will want. src/hotkeys_qt.rs — action_for_mini_key, a SIBLING of action_for_key with the context arm inverted. The main window still refuses Context::Mini and the test that pins it is untouched; a new test pins the mirror. src/hotkeys_bridge.rs — the ui.miniPlayer arm stops logging and toggles. qml/shell/ViewModeMenu.qml — the Miniplayer row goes live with its own dispatch arm, and it is hidden under the kiosk profile, 1:1 with PlayerBarSmall.slint:819. The kiosk port landed first, so that gate was owed here. Three comments claiming the row is inert are corrected. Surfaces 0, 3 and 4 are clamped to the artwork surface until their content exists (B3 and B4), because mini_surface and mini_default_view live in the prefs file shared with the Slint app: a user whose Slint mini was last on Queue would otherwise open onto a blank card with no visible way out. Each block deletes its own entry from that clamp. Enter does not hide the main window yet — window.hideToTray() is B6's, and open-coding a bare hide() here is what the one-visibility-owner rule forbids. So the main window stays visible behind the mini in this commit, by design. cc
41 lines
1.2 KiB
QML
41 lines
1.2 KiB
QML
// MiniExplicitBadge — the mini's parental-advisory chip (2026-08-03
|
|
// miniplayer/tray contract A-28, §4.2.3), port of `ExplicitBadge` at
|
|
// `crates/qbz-ui/ui/miniplayer/MiniBits.slint:9-23`.
|
|
//
|
|
// `MiniBits.slint` exports TWO components (ExplicitBadge :9, CoverArt :28) and
|
|
// a QML file declares exactly one root type, so the pair is split — this file
|
|
// and MiniCoverArt.qml (§15 trap 32).
|
|
//
|
|
// The glyph is a STYLED LETTER, not the official explicit.svg mask the Tauri
|
|
// build rendered at 13x13 / opacity 0.45. That is a deliberate divergence the
|
|
// reference records at MiniBits.slint:5-8 for app consistency, and it is
|
|
// REPRODUCED here rather than "fixed" back to the SVG.
|
|
//
|
|
// Takes NO properties — every call site mounts it bare.
|
|
|
|
import QtQuick
|
|
import "../theme"
|
|
|
|
Rectangle {
|
|
id: root
|
|
|
|
QbzTheme { id: theme }
|
|
|
|
width: 13
|
|
height: 13
|
|
radius: 3
|
|
antialiasing: true
|
|
color: theme.alphaTier(12)
|
|
|
|
Text {
|
|
anchors.fill: parent
|
|
// Literal, never translated (MiniBits.slint:16).
|
|
text: "E"
|
|
color: theme.alphaTier(55)
|
|
font.pixelSize: 8
|
|
font.weight: Font.DemiBold
|
|
horizontalAlignment: Text.AlignHCenter
|
|
verticalAlignment: Text.AlignVCenter
|
|
}
|
|
}
|