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:
1 file changed
+15
-14
@@ -2,11 +2,8 @@
|
|||||||
//
|
//
|
||||||
// Six ~80px icon+label tiles (Radius.sm rectangles, NO pills — ADR-008)
|
// Six ~80px icon+label tiles (Radius.sm rectangles, NO pills — ADR-008)
|
||||||
// replacing the desktop Sidebar on the kiosk panel, driving the SAME NavState
|
// 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
|
// routes. Net-new component; tokens/accent/radii/icons from the existing set.
|
||||||
// control-alignment standard: tokens/accent/radii only, no invented values,
|
// Labels reuse existing `@tr` msgids so no new `.po` strings are introduced.
|
||||||
// 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.
|
|
||||||
import { Theme } from "../foundation/semantic-colors.slint";
|
import { Theme } from "../foundation/semantic-colors.slint";
|
||||||
import { Radius } from "../foundation/radius.slint";
|
import { Radius } from "../foundation/radius.slint";
|
||||||
import { NavState, ContentView, ImmersiveState } from "../state.slint";
|
import { NavState, ContentView, ImmersiveState } from "../state.slint";
|
||||||
@@ -63,19 +60,24 @@ export component NavRail inherits Rectangle {
|
|||||||
|
|
||||||
background: Theme.surface-main;
|
background: Theme.surface-main;
|
||||||
|
|
||||||
VerticalLayout {
|
// Top hairline (overlay — kept out of the tile row).
|
||||||
spacing: 0px;
|
|
||||||
// Top hairline separating the rail from the transport bar.
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
x: 0;
|
||||||
|
y: 0;
|
||||||
|
width: root.width;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background: Theme.border-subtle;
|
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 {
|
HorizontalLayout {
|
||||||
// Fill the height below the hairline so tiles are full-height touch
|
x: 0;
|
||||||
// targets, and stretch each tile at the MOUNT site (a stretch set
|
y: 1px;
|
||||||
// only inside the child component's root is not honored by the
|
width: root.width;
|
||||||
// parent layout — that was why the tiles collapsed to icon width).
|
height: root.height - 1px;
|
||||||
vertical-stretch: 1;
|
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
spacing: 6px;
|
spacing: 6px;
|
||||||
|
|
||||||
@@ -135,4 +137,3 @@ export component NavRail inherits Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Reference in new issue
Block a user