diff --git a/crates/qbz-slint/ui/assets/icons/gandalf.svg b/crates/qbz-slint/ui/assets/icons/gandalf.svg new file mode 100644 index 000000000..4c5d0af65 --- /dev/null +++ b/crates/qbz-slint/ui/assets/icons/gandalf.svg @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + diff --git a/crates/qbz-slint/ui/primitives/DacWizardModal.slint b/crates/qbz-slint/ui/primitives/DacWizardModal.slint index 2ca49b93c..32c5e4093 100644 --- a/crates/qbz-slint/ui/primitives/DacWizardModal.slint +++ b/crates/qbz-slint/ui/primitives/DacWizardModal.slint @@ -20,6 +20,7 @@ import { QbzSelect } from "QbzSelect.slint"; import { CommandBlock } from "CommandBlock.slint"; import { WarningBanner } from "WarningBanner.slint"; import { SelectionCheckbox } from "SelectionCheckbox.slint"; +import { ListScrollbar } from "ListScrollbar.slint"; export component DacWizardModal inherits Rectangle { visible: DacWizardState.open; @@ -84,9 +85,9 @@ export component DacWizardModal inherits Rectangle { VerticalLayout { alignment: center; QbzIcon { - source: @image-url("../assets/icons/circle-check-big.svg"); - width: 24px; - height: 24px; + source: @image-url("../assets/icons/gandalf.svg"); + width: 26px; + height: 26px; tint: #3fae6a; } } @@ -150,9 +151,11 @@ export component DacWizardModal inherits Rectangle { } Rectangle { height: 1px; background: Theme.border-subtle; } - // Body — scrolls when a step outgrows the card. - Flickable { + // Body — scrolls when a step outgrows the card, with a visible + // scrollbar. Wrapped in a Rectangle so the scrollbar can overlay. + Rectangle { vertical-stretch: 1; + body-flick := Flickable { viewport-width: self.width; viewport-height: body.preferred-height; @@ -460,6 +463,17 @@ export component DacWizardModal inherits Rectangle { DacWizardActions.copy-command(DacWizardState.backup-cmd); } } + HorizontalLayout { + spacing: 10px; + alignment: start; + QbzCheckbox { checked <=> DacWizardState.review-backup-done; } + Text { + text: @tr("I created a backup"); + color: Theme.text-secondary; + font-size: Typography.legal; + vertical-alignment: center; + } + } // 2. Per-DAC config — collapsible accordions. for cfg[i] in DacWizardState.dac-configs: VerticalLayout { spacing: 8px; @@ -524,6 +538,17 @@ export component DacWizardModal inherits Rectangle { } } } + HorizontalLayout { + spacing: 10px; + alignment: start; + QbzCheckbox { checked <=> DacWizardState.review-config-done; } + Text { + text: @tr("I created the configuration files"); + color: Theme.text-secondary; + font-size: Typography.legal; + vertical-alignment: center; + } + } // 3. Restart (init-aware). CommandBlock { caption: @tr("3. Restart the audio services to load the config"); @@ -532,6 +557,17 @@ export component DacWizardModal inherits Rectangle { DacWizardActions.copy-command(DacWizardState.restart-cmd); } } + HorizontalLayout { + spacing: 10px; + alignment: start; + QbzCheckbox { checked <=> DacWizardState.review-restart-done; } + Text { + text: @tr("I restarted the audio services"); + color: Theme.text-secondary; + font-size: Typography.legal; + vertical-alignment: center; + } + } } // ── Step 4: self-service playback test ─────────── if DacWizardState.step == 4: VerticalLayout { @@ -704,6 +740,15 @@ export component DacWizardModal inherits Rectangle { } } } + } + ListScrollbar { + x: parent.width - self.width - 2px; + width: 12px; + height: 100%; + viewport-height: body-flick.viewport-height; + visible-height: body-flick.height; + viewport-y <=> body-flick.viewport-y; + } } Rectangle { height: 1px; background: Theme.border-subtle; } @@ -738,7 +783,11 @@ export component DacWizardModal inherits Rectangle { ? DacWizardState.welcome-confirmed : (DacWizardState.step == 2 ? (DacWizardState.any-dac-selected || DacWizardState.manual-valid) - : true); + : (DacWizardState.step == 3 + ? (DacWizardState.review-backup-done + && DacWizardState.review-config-done + && DacWizardState.review-restart-done) + : true)); clicked => { if (DacWizardState.step == 5) { DacWizardState.open = false; diff --git a/crates/qbz-slint/ui/settings/AudioSettings.slint b/crates/qbz-slint/ui/settings/AudioSettings.slint index 5284c865e..7df276987 100644 --- a/crates/qbz-slint/ui/settings/AudioSettings.slint +++ b/crates/qbz-slint/ui/settings/AudioSettings.slint @@ -237,6 +237,47 @@ export component AudioSettings inherits VerticalLayout { } } + // HiFi Wizard — guided bit-perfect DAC setup (PipeWire only). Lives at the + // end of BIT-PERFECT: the whole point of the wizard is bit-perfect. + if SettingsState.backend-is-pipewire: SettingRow { + label: @tr("HiFi Wizard"); + description: @tr("Auto-detect your DACs and set up bit-perfect playback, step by step."); + wizard-btn := Rectangle { + width: 160px; + height: 34px; + border-radius: Radius.sm; + border-width: 1px; + border-color: Theme.border-subtle; + background: wizard-ta.has-hover ? Theme.surface-hover : Theme.surface-elevated; + HorizontalLayout { + alignment: center; + spacing: 8px; + VerticalLayout { + alignment: center; + QbzIcon { + width: 18px; + height: 18px; + source: @image-url("../assets/icons/gandalf.svg"); + tint: Theme.text-primary; + } + } + Text { + text: @tr("Open Wizard"); + color: Theme.text-primary; + font-size: Typography.body; + font-weight: Typography.medium; + vertical-alignment: center; + } + } + wizard-ta := TouchArea { + mouse-cursor: pointer; + clicked => { + DacWizardActions.open(); + } + } + } + } + Rectangle { height: 12px; } Divider { } Rectangle { height: 12px; } @@ -269,35 +310,6 @@ export component AudioSettings inherits VerticalLayout { } } - // HiFi Wizard — guided DAC setup (PipeWire only, mirrors the Tauri gate). - if SettingsState.backend-is-pipewire: GroupHeader { text: @tr("DAC SETUP"); } - if SettingsState.backend-is-pipewire: SettingRow { - label: @tr("HiFi Wizard"); - description: @tr("Auto-detect your DACs and set up bit-perfect playback, step by step."); - wizard-btn := Rectangle { - width: 160px; - height: 34px; - border-radius: Radius.sm; - border-width: 1px; - border-color: Theme.border-subtle; - background: wizard-ta.has-hover ? Theme.surface-hover : Theme.surface-elevated; - Text { - text: @tr("Open Wizard"); - color: Theme.text-primary; - font-size: Typography.body; - font-weight: Typography.medium; - horizontal-alignment: center; - vertical-alignment: center; - } - wizard-ta := TouchArea { - mouse-cursor: pointer; - clicked => { - DacWizardActions.open(); - } - } - } - } - Rectangle { height: 20px; } // Reset — restores Audio + Playback defaults. diff --git a/crates/qbz-slint/ui/state.slint b/crates/qbz-slint/ui/state.slint index 4825bf467..dbabef720 100644 --- a/crates/qbz-slint/ui/state.slint +++ b/crates/qbz-slint/ui/state.slint @@ -3928,6 +3928,10 @@ export global DacWizardState { in-out property backup-cmd: ""; in-out property restart-cmd: ""; in-out property <[string]> created-paths: []; // done step + // Progress checkboxes (Tauri parity) — help the user track what they ran. + in-out property review-backup-done: false; + in-out property review-config-done: false; + in-out property review-restart-done: false; } export global DacWizardActions {