breadhelp: give the troubleshoot wizard proper CSD + rounded corners

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.
This commit is contained in:
Breadway 2026-07-30 19:05:01 +08:00
parent e0012f83b1
commit b67c681b3a
2 changed files with 20 additions and 0 deletions

View file

@ -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! {

View file

@ -37,6 +37,10 @@ pub fn open(parent: &impl IsA<gtk4::Window>, 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");