From ccd8c33f813692dd5ce38360b6975bbd2dd0bdea Mon Sep 17 00:00:00 2001 From: Mollusk Date: Fri, 29 May 2026 04:04:33 -0400 Subject: [PATCH] fix(gui): make the window background and weak-text colours actually apply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two theme fields had no visible effect: - window_bg mapped only to egui's window_fill, but the app draws on the bare background layer with no panel, so that's never painted — the real backdrop was a hardcoded GL clear colour. Paint a themed background rect (window_bg) behind everything in draw() instead. - weak_text was dead: egui's weak_text_color() derives from the text colour unless Visuals::weak_text_color is set, which it wasn't. Set it. Audited the rest (panel/input bg, text, accent, button, hover, and the five status colours) — those already resolve to the right egui fields. Co-Authored-By: Claude Opus 4.8 --- src/gui/mod.rs | 11 +++++++++++ src/gui/theme.rs | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/gui/mod.rs b/src/gui/mod.rs index 8e20686..328f1ea 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -939,6 +939,17 @@ impl PixelPassApp { apply_theme(ui.ctx(), &self.theme.active); self.theme.dirty = false; } + // Paint the themed window background behind everything. The app draws on + // egui's bare background layer with no panel, so `window_fill` is never + // shown — without this the only backdrop is the GL clear colour, which + // the theme can't reach. Painted first, so it sits behind the widgets. + let bg = if self.theme.editing { + self.theme.draft.window_bg + } else { + self.theme.active.window_bg + }; + ui.painter() + .rect_filled(ui.ctx().content_rect(), egui::CornerRadius::ZERO, bg); match self.screen { Screen::Menu => self.menu(ui), Screen::Host => self.host(ui), diff --git a/src/gui/theme.rs b/src/gui/theme.rs index 6376657..2ebc214 100644 --- a/src/gui/theme.rs +++ b/src/gui/theme.rs @@ -101,6 +101,9 @@ impl Theme { v.faint_bg_color = self.panel_bg; v.extreme_bg_color = self.input_bg; v.override_text_color = Some(self.text); + // `.weak()` text resolves via `weak_text_color()`, which derives from + // `text` unless this is set — so without it the weak-text field is dead. + v.weak_text_color = Some(self.weak_text); v.hyperlink_color = self.accent; v.error_fg_color = self.error; v.warn_fg_color = self.warning;