diff --git a/crates/qbz-ui/ui/shell/KioskLibrary.slint b/crates/qbz-ui/ui/shell/KioskLibrary.slint index 183b1503d..ae0519a49 100644 --- a/crates/qbz-ui/ui/shell/KioskLibrary.slint +++ b/crates/qbz-ui/ui/shell/KioskLibrary.slint @@ -5,6 +5,7 @@ // FavoritesActions.select-tab (Rust lazy-loads each tab). Covers are push-only // except album covers (windowed — v1 shows the first ~60; the window hook is a // follow-up). +import { ListView } from "std-widgets.slint"; import { Theme } from "../foundation/semantic-colors.slint"; import { Radius } from "../foundation/radius.slint"; import { FavoritesState, FavoritesActions } from "../state.slint"; @@ -77,17 +78,14 @@ export component KioskLibrary inherits Rectangle { vertical-stretch: 1; clip: true; - if FavoritesState.active-tab == "tracks": Flickable { - viewport-width: self.width; - viewport-height: tracklist.preferred-height; - tracklist := VerticalLayout { - padding: root.pad; - spacing: 2px; - for track in FavoritesState.tracks-visible: KioskTrackRow { - track: track; - play(id) => { - FavoritesActions.play-track(id); - } + // ListView windows the rows (only the visible band is mounted) — a + // plain VerticalLayout of every track spiked CPU on entry, which a Pi + // can't afford. + if FavoritesState.active-tab == "tracks": ListView { + for track in FavoritesState.tracks-visible: KioskTrackRow { + track: track; + play(id) => { + FavoritesActions.play-track(id); } } } diff --git a/crates/qbz-ui/ui/shell/KioskSearch.slint b/crates/qbz-ui/ui/shell/KioskSearch.slint index 09c3133a5..b75e6a41b 100644 --- a/crates/qbz-ui/ui/shell/KioskSearch.slint +++ b/crates/qbz-ui/ui/shell/KioskSearch.slint @@ -5,6 +5,7 @@ // The query is entered in the KioskShell back-bar field (SearchActions.submit); // this view is the tabbed results. Covers are push-only, so binding the shared // arrays is enough. +import { ListView } from "std-widgets.slint"; import { Theme } from "../foundation/semantic-colors.slint"; import { Radius } from "../foundation/radius.slint"; import { SearchState, SearchActions } from "../state.slint"; @@ -88,18 +89,12 @@ export component KioskSearch inherits Rectangle { } } - // Tracks — simple vertical list. - if SearchState.tab == 2: Flickable { - viewport-width: self.width; - viewport-height: tracklist.preferred-height; - tracklist := VerticalLayout { - padding: root.pad; - spacing: 2px; - for track in SearchState.tracks: KioskTrackRow { - track: track; - play(id) => { - root.media-action("track", id, "play"); - } + // Tracks — windowed list (ListView mounts only the visible band). + if SearchState.tab == 2: ListView { + for track in SearchState.tracks: KioskTrackRow { + track: track; + play(id) => { + root.media-action("track", id, "play"); } } } diff --git a/crates/qbz-ui/ui/shell/KioskShell.slint b/crates/qbz-ui/ui/shell/KioskShell.slint index b11afc022..13bc215c0 100644 --- a/crates/qbz-ui/ui/shell/KioskShell.slint +++ b/crates/qbz-ui/ui/shell/KioskShell.slint @@ -19,9 +19,10 @@ import { LineEdit } from "std-widgets.slint"; import { Theme } from "../foundation/semantic-colors.slint"; import { Layout } from "../foundation/layout.slint"; import { Radius } from "../foundation/radius.slint"; -import { NavState, ContentView, OfflineState, PlaylistState, PurchaseDetailState, SearchActions, UiFocusState } from "../state.slint"; +import { NavState, ContentView, OfflineState, PlaylistState, PurchaseDetailState, SearchActions, UiFocusState, AppearanceState } from "../state.slint"; import { PlayerBarSmall } from "PlayerBarSmall.slint"; import { NavRail } from "NavRail.slint"; +import { WindowControls } from "WindowControls.slint"; import { KioskDiscover } from "KioskDiscover.slint"; import { DiscoverBrowseView } from "../discover/DiscoverBrowseView.slint"; import { RecentAlbumsView } from "../discover/RecentAlbumsView.slint"; @@ -108,15 +109,21 @@ export component KioskShell inherits Rectangle { // lives in the HeaderBar, which the kiosk drops, so a persistent search // field here is what makes Search functional; Enter submits through the // same SearchActions seam the header uses and lands on the results view. - Rectangle { + backbar := Rectangle { height: Layout.header-height; background: Theme.surface-card; + // The kiosk carries no HeaderBar, so it owns the window chrome too. + // macOS overlay leaves the native traffic-light inset; Linux frameless + // draws the custom WindowControls. OS-agnostic on purpose (the kiosk + // is not restricted to any platform). + property mac-inset: AppearanceState.is-macos && !AppearanceState.system-title-bar-active ? 78px : 0px; + property lin-chrome: !AppearanceState.is-macos && !AppearanceState.system-title-bar-active && AppearanceState.show-window-controls; HorizontalLayout { - padding-left: 6px; - padding-right: 8px; + padding-left: 6px + backbar.mac-inset; + padding-right: backbar.lin-chrome ? 118px : 8px; padding-top: 4px; padding-bottom: 4px; - spacing: 8px; + spacing: 6px; back-btn := Rectangle { width: 44px; border-radius: Radius.sm; @@ -135,6 +142,24 @@ export component KioskShell inherits Rectangle { } } } + fwd-btn := Rectangle { + width: 44px; + border-radius: Radius.sm; + background: fwd-ta.has-hover && NavState.can-forward ? Theme.alpha-8 : transparent; + opacity: NavState.can-forward ? 1.0 : 0.32; + Image { + source: @image-url("../assets/icons/chevron-right.svg"); + colorize: Theme.text-secondary; + width: 22px; + height: 22px; + } + fwd-ta := TouchArea { + enabled: NavState.can-forward; + clicked => { + NavState.request-forward(); + } + } + } search-field := LineEdit { horizontal-stretch: 1; placeholder-text: @tr("Search"); @@ -150,6 +175,11 @@ export component KioskShell inherits Rectangle { } } } + // Linux custom window controls at the right edge. + if backbar.lin-chrome: WindowControls { + x: backbar.width - self.preferred-width - 8px; + y: (backbar.height - self.preferred-height) / 2; + } } // --- Content frame (mirrors AppShell:237-279 arithmetic-height pattern). diff --git a/crates/qbz-ui/ui/shell/PlayerBarSmall.slint b/crates/qbz-ui/ui/shell/PlayerBarSmall.slint index 393808c3d..a533444ec 100644 --- a/crates/qbz-ui/ui/shell/PlayerBarSmall.slint +++ b/crates/qbz-ui/ui/shell/PlayerBarSmall.slint @@ -741,7 +741,7 @@ export component PlayerBarSmall inherits Rectangle { height: 215px; close-policy: close-on-click; ContextMenu { - ContextMenuItem { + if !ShellState.kiosk-profile: ContextMenuItem { icon: @image-url("../assets/icons/panel-left.svg"); label: @tr("New"); selected: ShellState.npb-mode == 0; @@ -749,7 +749,7 @@ export component PlayerBarSmall inherits Rectangle { root.media-action("npb-view", "", "new"); } } - ContextMenuItem { + if !ShellState.kiosk-profile: ContextMenuItem { icon: @image-url("../assets/icons/panel-right-close.svg"); label: @tr("Classic"); selected: ShellState.npb-mode == 1; @@ -757,7 +757,7 @@ export component PlayerBarSmall inherits Rectangle { root.media-action("npb-view", "", "classic"); } } - ContextMenuItem { + if !ShellState.kiosk-profile: ContextMenuItem { icon: @image-url("../assets/icons/rows-3.svg"); label: @tr("Small"); selected: ShellState.npb-mode == 2; @@ -765,7 +765,7 @@ export component PlayerBarSmall inherits Rectangle { root.media-action("npb-view", "", "small"); } } - ContextMenuItem { + if !ShellState.kiosk-profile: ContextMenuItem { icon: @image-url("../assets/icons/layout-grid.svg"); label: @tr("Large"); selected: ShellState.npb-mode == 3; @@ -780,7 +780,7 @@ export component PlayerBarSmall inherits Rectangle { root.media-action("npb-view", "", "large"); } } - Rectangle { + if !ShellState.kiosk-profile: Rectangle { height: 7px; Rectangle { height: 1px;