fix(shell): macOS NPB-Small bottom clearance via Rust-set npb-small-extra

The 2px .slint literal proved invisible (owner ask 2026-07-21, iteration
2026-07-22). The extra clearance is now set from Rust at startup
(ShellState.npb-small-extra, default 6px, macOS-only, QBZ_NPB_SMALL_EXTRA
env override) so tuning costs a ~2-minute qbz-bin rebuild instead of a
~2 h qbz-ui one on the 8 GB Mac. Linux stays pixel-identical (extra = 0).

km
This commit is contained in:
vicrodh committed 2026-07-22 16:49:23 -06:00
1 parent 6c5996cc50
commit f9a8edcbeb
3 files changed
+33 -13

No files matched your search

+9 -8
View File
@@ -126,9 +126,10 @@ export component PlayerBarSmall inherits Rectangle {
// One bar, header-height tall: a 3px top seekbar strip + the controls row
// that fills the rest (no band bump — the large album art defines the height).
// macOS: +2px (ShellState.npb-small-height) so the meta line never clips at
// the window's bottom edge; the song card below keeps its 39px top-anchored
// geometry, so the extra height lands as bottom clearance.
// macOS: taller by ShellState.npb-small-extra (Rust-set, default 6px) so
// the meta line never clips at the window's bottom edge/bezel; the song
// card below keeps its 39px top-anchored geometry, so the extra height
// lands as bottom clearance.
height: ShellState.npb-small-height;
background: ShellState.app-background-active
? Theme.surface-card.with-alpha(AppearanceState.app-background-surface-alpha)
@@ -229,11 +230,11 @@ export component PlayerBarSmall inherits Rectangle {
// The wrapper takes the row's vertical stretch; the card
// itself is pinned to the pre-2.0.2 39px top-anchored
// geometry (Layout.header-height − 3px seekbar) so macOS's
// +2px bar (ShellState.npb-small-height) lands BELOW the
// card: the art keeps its exact top-relative position and
// the meta line gains 2px of bottom clearance (owner ask
// 2026-07-21). Linux: wrapper height == card height →
// pixel-identical to before.
// taller bar (ShellState.npb-small-extra, Rust-set) lands
// BELOW the card: the art keeps its exact top-relative
// position and the meta line gains the extra as bottom
// clearance (owner ask 2026-07-21). Linux: wrapper height
// == card height → pixel-identical to before.
Rectangle {
horizontal-stretch: 1;
SongCard {
+11 -5
View File
@@ -4031,14 +4031,20 @@ export global ShellState {
// "new"|"classic"|"small"|"large"); set on startup from the store and on the
// player bar's "Now Playing view" menu select.
in-out property <int> npb-mode: 0;
// Small-mode (2) bar height. macOS-only +2px (owner ask 2026-07-21): the
// Small-mode (2) bar extra bottom clearance (owner ask 2026-07-21): the
// compact bar's CJK/descender-heavy meta line clipped at the window's
// bottom edge. The bar is bottom-anchored, so it grows UPWARD;
// PlayerBarSmall pins the song card to its old top-anchored geometry so
// the art keeps its position and the 2px land as bottom clearance.
// bottom edge/bezel on macOS. The bar is bottom-anchored, so it grows
// UPWARD; PlayerBarSmall pins the song card to its old top-anchored
// geometry so the art keeps its position and the extra lands as bottom
// clearance. The AMOUNT is set from Rust at startup (main.rs, macOS-only
// — 0 elsewhere; QBZ_NPB_SMALL_EXTRA env override for tuning) because a
// .slint literal costs a ~2 h qbz-ui rebuild on the 8 GB Mac per
// iteration, a Rust-side constant ~2 min. 2px proved invisible
// (2026-07-22).
in-out property <length> npb-small-extra: 0px;
// (42px == Layout.header-height; literal kept so state.slint needs no
// foundation import — same precedent as large-dock-width below.)
out property <length> npb-small-height: 42px + (AppearanceState.is-macos ? 2px : 0px);
out property <length> npb-small-height: 42px + root.npb-small-extra;
// Large NPB (mode 3) is only valid while the sidebar is OPEN (state 0): the
// cover + spectrum dock lives at the bottom of the open sidebar. Views read
// this to mount the dock and to drive the FFT visualizer tap.