fix(kiosk): pin NavRail row to root.width so tiles distribute

The tiles still collapsed to the bottom-left even with per-tile
horizontal-stretch: a HorizontalLayout nested in the rail's VerticalLayout
was taking its preferred (content) width, not the rail width. Drop the
wrapper, make the tile row an explicit width: root.width child with the
hairline as an overlay, and the 6 tiles now spread evenly across the panel.

cc
This commit is contained in:
vicrodh committed 2026-07-10 19:21:48 -06:00
1 parent ce2db8cb54
commit f27d5e864c
1 file changed
+15 -14
+15 -14
View File
@@ -2,11 +2,8 @@
//
// Six ~80px icon+label tiles (Radius.sm rectangles, NO pills — ADR-008)
// replacing the desktop Sidebar on the kiosk panel, driving the SAME NavState
// routes. Net-new component; patterned after the Sidebar's nav rows and the
// control-alignment standard: tokens/accent/radii only, no invented values,
// icons from the existing `assets/icons` set. Labels reuse existing `@tr`
// msgids (Discover/Library/Search/Now Playing/Visualizer/Settings) so no new
// `.po` strings are introduced.
// routes. Net-new component; tokens/accent/radii/icons from the existing set.
// Labels reuse existing `@tr` msgids so no new `.po` strings are introduced.
import { Theme } from "../foundation/semantic-colors.slint";
import { Radius } from "../foundation/radius.slint";
import { NavState, ContentView, ImmersiveState } from "../state.slint";
@@ -63,19 +60,24 @@ export component NavRail inherits Rectangle {
background: Theme.surface-main;
VerticalLayout {
spacing: 0px;
// Top hairline separating the rail from the transport bar.
// Top hairline (overlay — kept out of the tile row).
Rectangle {
x: 0;
y: 0;
width: root.width;
height: 1px;
background: Theme.border-subtle;
}
// Tile row. EXPLICIT `width: root.width` — a HorizontalLayout nested inside
// a VerticalLayout was not filling the rail width, so the tiles collapsed to
// icon width packed on the left. Pinning the row to the rail's full width
// lets each tile's horizontal-stretch distribute them evenly across it.
HorizontalLayout {
// Fill the height below the hairline so tiles are full-height touch
// targets, and stretch each tile at the MOUNT site (a stretch set
// only inside the child component's root is not honored by the
// parent layout — that was why the tiles collapsed to icon width).
vertical-stretch: 1;
x: 0;
y: 1px;
width: root.width;
height: root.height - 1px;
padding: 8px;
spacing: 6px;
@@ -135,4 +137,3 @@ export component NavRail inherits Rectangle {
}
}
}
}