Files
qbz/crates/qbz-ui/ui/shell/KioskTrackRow.slint
T
vicrodh f1eeaf9126 feat(steam-deck): game mode support (plan PR1-PR5)
- PR1: gamescope detection at boot — X11 backend, scale 1, kiosk
  fullscreen; tray + miniplayer suppressed (click-offset fix).
- PR2: full keyboard navigation for the kiosk (3 zones, focus ring,
  scroll-into-view; typing never navigates).
- PR3: native gamepad via gilrs — D-pad/stick/A/B to synthetic Slint
  keys with hysteresis, repeat and debounce; B suppresses Escape while
  a text field is focused (closes the Steam OSK).
- PR4: Steam OSK via the steam://open/keyboard deeplink on text focus.
- PR5: scripts/qbz-add-to-steam (stdlib-only, 19/19 unit tests) with
  artwork assets + pure-gamepad controller layout.

Spec: qbz-nix-docs/steam-deck/STEAM_DECK_GAME_MODE_PLAN.md

km
2026-07-25 12:04:58 -06:00

80 lines
2.4 KiB
Plaintext

// KioskTrackRow — lightweight track row for the kiosk Search/Library track
// tabs (2.0.2 frente #3). Art + title/artist + duration, tap to play. Takes the
// shared TrackItem so it works for both SearchState.tracks and
// FavoritesState.tracks-visible.
import { Theme } from "../foundation/semantic-colors.slint";
import { Radius } from "../foundation/radius.slint";
import { TrackItem } from "../state.slint";
export component KioskTrackRow inherits Rectangle {
in property <TrackItem> track;
// Keyboard/gamepad nav (PR 2) — same ring idiom as KioskCard.
in property <bool> nav-focused: false;
callback play(string);
height: 62px;
border-radius: Radius.sm;
background: root.nav-focused ? Theme.accent.with-alpha(0.18) : ta.has-hover ? Theme.alpha-6 : transparent;
border-width: root.nav-focused ? 2px : 0px;
border-color: Theme.accent;
HorizontalLayout {
padding-left: 8px;
padding-right: 14px;
spacing: 12px;
// Art slot — fixed 46x46 centered in the row height.
Rectangle {
width: 46px;
Rectangle {
width: 46px;
height: 46px;
y: (parent.height - self.height) / 2;
border-radius: 5px;
background: Theme.surface-elevated;
clip: true;
Image {
width: 100%;
height: 100%;
source: root.track.artwork;
image-fit: cover;
}
}
}
VerticalLayout {
horizontal-stretch: 1;
alignment: center;
spacing: 2px;
Text {
text: root.track.title;
color: Theme.text-primary;
font-size: 15px;
font-weight: 500;
overflow: elide;
wrap: no-wrap;
}
Text {
text: root.track.artist;
color: Theme.text-muted;
font-size: 13px;
overflow: elide;
wrap: no-wrap;
}
}
Text {
text: root.track.duration;
color: Theme.text-muted;
font-size: 13px;
vertical-alignment: center;
}
}
ta := TouchArea {
clicked => {
root.play(root.track.id);
}
}
}