From fa7aa46ce17f8a0528a3d6b2ddda913c5aa81b06 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sat, 13 Jun 2026 09:19:11 -0600 Subject: [PATCH] feat(slint): immersive header - segmented mode bar in the compact-player style Replaces the provisional S2 ModeBar with the polished segmented mode pill, copying the compact player's visual language (owner instruction). - Pill tokens copied verbatim from ImmersivePlayerBar: background #00000080, 1px #ffffff2e border, drop-shadow blur 32 / #00000066 / offset-y 8 (the shadow is the main upgrade - the provisional bar had none), radius 12. - 4 tabs (icon + label): Album Reactive / Static / Coverflow / Spectrum, with existing icon assets. States per chrome.md: idle #ffffffb3, hover #ffffff1f bg / #fffffff2, active #ffffff33 bg / #ffffff; 13px, weight 500->600; 150ms background animate. Leading panel-left glyph + 1px divider (decorative). - Mount site unchanged: same chrome-visible auto-hide opacity (on the instance, not the root), same select(idx) => mode + wake() wiring, no second timer. - The 4 mode foregrounds, player, volume fix, atmosphere, responsive sizing, and ESC are untouched. Logged nits: border alpha matches the player (0.18) not the Tauri header tabs (0.15) - intentional for one design language; leading panel icon is inert (Tauri's is a functional split/focus toggle, out of scope). cc --- .../ui/immersive/ImmersiveView.slint | 81 +++++++++++++++---- 1 file changed, 66 insertions(+), 15 deletions(-) diff --git a/crates/qbz-slint/ui/immersive/ImmersiveView.slint b/crates/qbz-slint/ui/immersive/ImmersiveView.slint index 1c8dce641..3197ed34d 100644 --- a/crates/qbz-slint/ui/immersive/ImmersiveView.slint +++ b/crates/qbz-slint/ui/immersive/ImmersiveView.slint @@ -417,37 +417,53 @@ component ImmersivePlayerBar inherits Rectangle { } } -// PROVISIONAL mode selector (top-center). A deliberately plain segmented bar to -// be replaced by the polished header in a later session (S6). Four tabs map tab -// position -> ImmersiveState.mode (0 Album Reactive, 1 Static, 2 Coverflow, -// 3 Spectrum). Each tab has its own TouchArea (pointer cursor); no `changed -// x/y/width/height` watchers (Recursion-detected risk). Fixed container height, -// tabs sized to content via HorizontalLayout. Clicking sets the mode and wakes -// the chrome so the bar resets its hide timer with the player. +// Polished segmented mode selector (top-center). Rebuilt in the compact +// player's visual language (ImmersivePlayerBar:238-243): flat dark pill +// (#00000080), 1px white-on-glass border (#ffffff2e), drop-shadow. Four +// icon+label tabs map tab position -> ImmersiveState.mode (0 Album Reactive, +// 1 Static, 2 Coverflow, 3 Spectrum), with an inert leading panel-icon + a +// vertical divider as a section marker (mirrors Tauri's .mode-toggle + +// .tab-divider). Each tab has its own TouchArea (pointer cursor); no `changed +// x/y/width/height` watchers (Recursion-detected risk). Container height fixed; +// width sized to content. Clicking sets the mode and wakes the chrome so the +// bar resets its hide timer with the player. component ModeTab inherits Rectangle { + in property icon; in property label; in property idx; callback clicked(); property active: ImmersiveState.mode == root.idx; + property fg: root.active ? #ffffff : (ta.has-hover ? #fffffff2 : #ffffffb3); height: 28px; border-radius: 8px; background: root.active ? #ffffff33 : (ta.has-hover ? #ffffff1f : transparent); + animate background { duration: 150ms; } HorizontalLayout { - padding-left: 14px; - padding-right: 14px; + padding-left: 16px; + padding-right: 16px; + spacing: 8px; + alignment: center; + VerticalLayout { alignment: center; - Text { - text: root.label; - color: root.active ? #ffffff : #ffffffb3; - font-size: 13px; - font-weight: root.active ? 600 : 400; - vertical-alignment: center; + QbzIcon { + source: root.icon; + width: 16px; + height: 16px; + tint: root.fg; } } + Text { + text: root.label; + color: root.fg; + font-size: 13px; + font-weight: root.active ? 600 : 500; + vertical-alignment: center; + animate color { duration: 150ms; } + } } ta := TouchArea { @@ -465,28 +481,63 @@ component ModeBar inherits Rectangle { background: #00000080; border-width: 1px; border-color: #ffffff2e; + drop-shadow-blur: 32px; + drop-shadow-color: #00000066; + drop-shadow-offset-y: 8px; bar := HorizontalLayout { x: 4px; y: 4px; height: 28px; spacing: 4px; + alignment: center; + + // Inert leading panel-icon (section marker, no callback). + Rectangle { + width: 28px; + height: 28px; + QbzIcon { + source: @image-url("../assets/icons/panel-left.svg"); + width: 16px; + height: 16px; + x: Math.round((parent.width - self.width) / 2 / 1px) * 1px; + y: Math.round((parent.height - self.height) / 2 / 1px) * 1px; + tint: #ffffffd9; + } + } + // Vertical divider between the marker and the first tab. + Rectangle { + width: 9px; + height: 28px; + Rectangle { + width: 1px; + height: 20px; + x: Math.round((parent.width - self.width) / 2 / 1px) * 1px; + y: Math.round((parent.height - self.height) / 2 / 1px) * 1px; + background: #ffffff33; + } + } + ModeTab { + icon: @image-url("../assets/icons/audio-lines.svg"); label: @tr("Album Reactive"); idx: 0; clicked => { root.select(0); } } ModeTab { + icon: @image-url("../assets/icons/image.svg"); label: @tr("Static"); idx: 1; clicked => { root.select(1); } } ModeTab { + icon: @image-url("../assets/icons/disc-3.svg"); label: @tr("Coverflow"); idx: 2; clicked => { root.select(2); } } ModeTab { + icon: @image-url("../assets/icons/chart-no-axes-column.svg"); label: @tr("Spectrum"); idx: 3; clicked => { root.select(3); }