From b67c681b3a51876260a472c3356a4ab3e94e53d0 Mon Sep 17 00:00:00 2001 From: Breadway Date: Thu, 30 Jul 2026 19:05:01 +0800 Subject: [PATCH] breadhelp: give the troubleshoot wizard proper CSD + rounded corners MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same fix as breadbar's wifi add-network dialog: a bare gtk4::Window with no titlebar falls back to GTK's own minimal CSD (flat bar, plain system-font title, square corners) — a real HeaderBar (which picks up the window's title automatically) plus matching dark/rounded theming on window.wizard-dialog makes this look like part of the app instead of a stray window from a different decade. Didn't hit the accent-button rendering quirk noted in breadbar's dialog fix — this wizard's buttons are plain option/close buttons, no suggested-action/confirm-button in play. --- src/theme.rs | 16 ++++++++++++++++ src/ui/troubleshoot_wizard.rs | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/theme.rs b/src/theme.rs index 0f87d6f..505939a 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -53,6 +53,22 @@ window.tour-window { background-color: transparent; }\n\ the \"Show me\" fallback as its own beat, not a continuation of the \ instructional paragraph above it. */\n\ .tour-hint-row { margin-top: 8px; }\n\ +/* ui::troubleshoot_wizard — a bare gtk4::Window with no titlebar falls back \ + to GTK's own minimal CSD (flat bar, plain system-font title, square \ + corners), which read as a stray window from a different decade next to \ + the rest of this (rounded, borderless) app. A real HeaderBar (set in \ + troubleshoot_wizard::open) picks up the window's title automatically; \ + this just makes it and the window match the shared dark theme instead \ + of GTK's default light-grey CSD chrome. */\n\ +window.wizard-dialog { background-color: @bg; color: @on-bg; border-radius: 10px; }\n\ +window.wizard-dialog headerbar { \ + background-color: @bg; \ + color: @on-bg; \ + border-top-left-radius: 10px; \ + border-top-right-radius: 10px; \ + border-bottom: 1px solid alpha(@on-bg, 0.08); \ + box-shadow: none; \ +}\n\ "; thread_local! { diff --git a/src/ui/troubleshoot_wizard.rs b/src/ui/troubleshoot_wizard.rs index e152678..f3c4bf2 100644 --- a/src/ui/troubleshoot_wizard.rs +++ b/src/ui/troubleshoot_wizard.rs @@ -37,6 +37,10 @@ pub fn open(parent: &impl IsA, on_build: impl FnOnce(&Window)) { .default_width(480) .default_height(360) .build(); + window.add_css_class("wizard-dialog"); + let header = gtk4::HeaderBar::new(); + header.set_show_title_buttons(true); + window.set_titlebar(Some(&header)); let content = GBox::new(Orientation::Vertical, 12); content.add_css_class("view-content");