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
This commit is contained in:
vicrodh committed 2026-06-13 09:19:11 -06:00
1 parent 29e0ac75f7
commit fa7aa46ce1
1 file changed
+63 -12
@@ -417,36 +417,52 @@ component ImmersivePlayerBar inherits Rectangle {
} }
} }
// PROVISIONAL mode selector (top-center). A deliberately plain segmented bar to // Polished segmented mode selector (top-center). Rebuilt in the compact
// be replaced by the polished header in a later session (S6). Four tabs map tab // player's visual language (ImmersivePlayerBar:238-243): flat dark pill
// position -> ImmersiveState.mode (0 Album Reactive, 1 Static, 2 Coverflow, // (#00000080), 1px white-on-glass border (#ffffff2e), drop-shadow. Four
// 3 Spectrum). Each tab has its own TouchArea (pointer cursor); no `changed // icon+label tabs map tab position -> ImmersiveState.mode (0 Album Reactive,
// x/y/width/height` watchers (Recursion-detected risk). Fixed container height, // 1 Static, 2 Coverflow, 3 Spectrum), with an inert leading panel-icon + a
// tabs sized to content via HorizontalLayout. Clicking sets the mode and wakes // vertical divider as a section marker (mirrors Tauri's .mode-toggle +
// the chrome so the bar resets its hide timer with the player. // .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 { component ModeTab inherits Rectangle {
in property <image> icon;
in property <string> label; in property <string> label;
in property <int> idx; in property <int> idx;
callback clicked(); callback clicked();
property <bool> active: ImmersiveState.mode == root.idx; property <bool> active: ImmersiveState.mode == root.idx;
property <color> fg: root.active ? #ffffff : (ta.has-hover ? #fffffff2 : #ffffffb3);
height: 28px; height: 28px;
border-radius: 8px; border-radius: 8px;
background: root.active ? #ffffff33 : (ta.has-hover ? #ffffff1f : transparent); background: root.active ? #ffffff33 : (ta.has-hover ? #ffffff1f : transparent);
animate background { duration: 150ms; }
HorizontalLayout { HorizontalLayout {
padding-left: 14px; padding-left: 16px;
padding-right: 14px; padding-right: 16px;
spacing: 8px;
alignment: center;
VerticalLayout { VerticalLayout {
alignment: center; alignment: center;
QbzIcon {
source: root.icon;
width: 16px;
height: 16px;
tint: root.fg;
}
}
Text { Text {
text: root.label; text: root.label;
color: root.active ? #ffffff : #ffffffb3; color: root.fg;
font-size: 13px; font-size: 13px;
font-weight: root.active ? 600 : 400; font-weight: root.active ? 600 : 500;
vertical-alignment: center; vertical-alignment: center;
} animate color { duration: 150ms; }
} }
} }
@@ -465,28 +481,63 @@ component ModeBar inherits Rectangle {
background: #00000080; background: #00000080;
border-width: 1px; border-width: 1px;
border-color: #ffffff2e; border-color: #ffffff2e;
drop-shadow-blur: 32px;
drop-shadow-color: #00000066;
drop-shadow-offset-y: 8px;
bar := HorizontalLayout { bar := HorizontalLayout {
x: 4px; x: 4px;
y: 4px; y: 4px;
height: 28px; height: 28px;
spacing: 4px; 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 { ModeTab {
icon: @image-url("../assets/icons/audio-lines.svg");
label: @tr("Album Reactive"); label: @tr("Album Reactive");
idx: 0; idx: 0;
clicked => { root.select(0); } clicked => { root.select(0); }
} }
ModeTab { ModeTab {
icon: @image-url("../assets/icons/image.svg");
label: @tr("Static"); label: @tr("Static");
idx: 1; idx: 1;
clicked => { root.select(1); } clicked => { root.select(1); }
} }
ModeTab { ModeTab {
icon: @image-url("../assets/icons/disc-3.svg");
label: @tr("Coverflow"); label: @tr("Coverflow");
idx: 2; idx: 2;
clicked => { root.select(2); } clicked => { root.select(2); }
} }
ModeTab { ModeTab {
icon: @image-url("../assets/icons/chart-no-axes-column.svg");
label: @tr("Spectrum"); label: @tr("Spectrum");
idx: 3; idx: 3;
clicked => { root.select(3); } clicked => { root.select(3); }