fix(gui): make the window background and weak-text colours actually apply

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 <noreply@anthropic.com>
This commit is contained in:
2026-05-29 04:04:33 -04:00
parent c876c61ec6
commit ccd8c33f81
2 changed files with 14 additions and 0 deletions
+11
View File
@@ -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),
+3
View File
@@ -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;