Contract sections 4, 5, 6 and the QML half of 7.
ContentRouter.qml is the D3 extraction: ONE view-mount chain, shared by both
shells. The Slint kiosk's content block is a verbatim copy of AppShell's and
KioskShell.slint:10-17 names this extraction as the follow-up it was waiting
for. 23 desktop arms carried over with their comments, 8 kiosk overrides, and
the kiosk-only nowplaying route. AppShell's four viewLoader.item sites now go
through contentRouter.currentItem; a tree-wide grep confirmed no other
reference (LESSONS L4 -- grep, do not trust memory about "both places").
KioskShell.qml carries the back bar with the full search focus lifecycle, the
content-height arithmetic including the now-playing exception, the offline
gate, the forced small transport, the player-zone focus ring, the root key
handler and the 30ms initial focus grab. Two findings worth keeping:
- the NavRail tiles fire header-menu-navigate("favorites-tracks") in the
reference, which switches the view AND selects a landing tab; navigateTo
carries only the route, so the tiles reuse the port's existing pending-tab
handshake rather than landing on the wrong tab.
- the visualizer tile's action is a sanctioned no-op (R2). Wiring
QbzImmersive would be worse than nothing: `open` would go true over an
empty mount and the key guard would then reject every key against a
surface that renders nothing.
Three fractional font sizes had to be rounded. Qt's font.pixelSize is an INT
property, so the reference's 11.5px (NavRail.slint:47) and 12.5px
(KioskNowPlaying.slint:59,67) are not expressible; font.pointSize is the only
real-valued alternative and is DPI-relative, which would make those three
labels scale differently from every other in the tree.
The NavRail one was caught by the offscreen smoke run IN THE KIOSK PROFILE --
it made the whole rail unavailable, i.e. a kiosk with no footer. The build,
both QML audits and qmllint were all green while that was true, and the
desktop smoke was clean because it never mounts KioskShell. The other two
were still latent: KioskNowPlaying is not on the smoke's route.
Gate: build 9 warnings = baseline, 291 tests, both audits OK over 229 QML
files (+15), qmllint filtered = the same 20 pre-existing ArtistView lines and
nothing else, kiosk-profile offscreen smoke clean.
cc
87 lines
2.7 KiB
QML
87 lines
2.7 KiB
QML
// KioskArtistCard — lightweight round artist card for the kiosk
|
|
// Search/Library/LocalLibrary artist tabs (shell/KioskArtistCard.slint).
|
|
// Round avatar + centred name, tap to open. No overlay row, no context menu,
|
|
// no follow button — the deliberate absences of the whole kiosk card family.
|
|
//
|
|
// The Slint takes primitive fields so ONE component serves both producer
|
|
// shapes; the Qt port takes the row object and reads both spellings for the
|
|
// same reason: search artists arrive as { id, title, artwork } (SlimItem) and
|
|
// favourite artists as { id, name, image } (FavoriteArtistItem). `artwork` /
|
|
// `image` carry the RESOLVED local avatar path the hosting view supplies, not
|
|
// the remote url.
|
|
//
|
|
// The CARD corner is 8px even though the avatar inside is a full circle.
|
|
|
|
import QtQuick
|
|
import "../theme"
|
|
|
|
Rectangle {
|
|
id: root
|
|
|
|
property var artist: ({})
|
|
property real artSize: 128
|
|
/// Keyboard/gamepad nav — same ring idiom as KioskCard.
|
|
property bool navFocused: false
|
|
signal clicked(string id)
|
|
|
|
QbzTheme { id: theme }
|
|
|
|
readonly property string _id: root.artist && root.artist.id ? root.artist.id : ""
|
|
readonly property string _name: root.artist
|
|
? (root.artist.name ? root.artist.name : (root.artist.title ? root.artist.title : ""))
|
|
: ""
|
|
readonly property string _avatar: root.artist
|
|
? (root.artist.artwork ? root.artist.artwork : (root.artist.image ? root.artist.image : ""))
|
|
: ""
|
|
|
|
implicitWidth: root.artSize
|
|
width: root.artSize
|
|
implicitHeight: body.implicitHeight
|
|
border.width: root.navFocused ? 3 : 0
|
|
border.color: theme.accent
|
|
radius: theme.radiusSm
|
|
color: root.navFocused
|
|
? Qt.rgba(theme.accent.r, theme.accent.g, theme.accent.b, 0.12)
|
|
: "transparent"
|
|
|
|
Column {
|
|
id: body
|
|
width: root.artSize
|
|
spacing: 8
|
|
|
|
Rectangle {
|
|
id: avatarTile
|
|
width: root.artSize
|
|
height: root.artSize
|
|
radius: root.artSize / 2
|
|
color: theme.surfaceElevated
|
|
clip: true
|
|
|
|
RoundedImage {
|
|
anchors.fill: parent
|
|
source: root._avatar
|
|
radius: avatarTile.radius
|
|
fit: "crop"
|
|
}
|
|
}
|
|
|
|
Text {
|
|
width: root.artSize
|
|
text: root._name
|
|
color: theme.textPrimary
|
|
font.pixelSize: 13
|
|
font.weight: theme.weightSemibold
|
|
horizontalAlignment: Text.AlignHCenter
|
|
elide: Text.ElideRight
|
|
wrapMode: Text.NoWrap
|
|
maximumLineCount: 1
|
|
}
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
hoverEnabled: false
|
|
onClicked: root.clicked(root._id)
|
|
}
|
|
}
|