Skip to content

GUI: fix light background at startup on light-mode systems#22

Merged
swilcox merged 1 commit into
mainfrom
fix-windows-light-theme
Jul 13, 2026
Merged

GUI: fix light background at startup on light-mode systems#22
swilcox merged 1 commit into
mainfrom
fix-windows-light-theme

Conversation

@swilcox

@swilcox swilcox commented Jul 12, 2026

Copy link
Copy Markdown
Owner

On Windows (or any OS in light mode) the app started with egui's stock light visuals — pattern area and panels light — until the user cycled the theme, which then looked correct.

Cause: egui follows the system light/dark preference by default and keeps two visuals slots. apply_theme used ctx.set_visuals, which writes only the currently active slot. At startup that was the dark slot; once winit delivered the system's light preference, egui switched to the light slot containing its stock visuals. Cycling the theme re-ran apply_theme against the now-active light slot, masking the bug.

Fix: apply_theme now pins ThemePreference::Dark and writes the rtrax palette into both slots via set_visuals_of, so the OS preference can no longer surface un-themed visuals. rtrax themes fully own the palette; OS light/dark isn't a meaningful input here.

Verified on macOS (no regression); needs a quick launch on the light-mode Windows machine to confirm the startup background is now dark.

egui follows the system light/dark theme by default and keeps separate
visuals slots per mode; set_visuals only writes the active slot. On
light-mode systems (seen on Windows) the app started with egui's stock
light visuals until the first theme cycle rewrote the now-active slot.
Pin ThemePreference::Dark and fill both slots with the rtrax palette.
@swilcox
swilcox merged commit de97fc4 into main Jul 13, 2026
7 checks passed
@swilcox
swilcox deleted the fix-windows-light-theme branch July 15, 2026 23:10
@swilcox swilcox mentioned this pull request Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant