From af477d54a0e4161167fef1a88066f85ec2238278 Mon Sep 17 00:00:00 2001 From: asm512 <31016869+asm512@users.noreply.github.com> Date: Sun, 22 Nov 2026 20:21:40 +0000 Subject: [PATCH] keep the dark theme when windows is in light mode --- src/main.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main.rs b/src/main.rs index 6ef3181..866a35f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3988,6 +3988,8 @@ fn setup_style(ctx: &egui::Context) { ctx.set_fonts(fonts); // neon sunset theme matching dusk purple magenta and golden amber + // the palette is dark only so the windows light mode must not switch egui to its light style + ctx.set_theme(egui::Theme::Dark); let mut vis = egui::Visuals::dark(); vis.panel_fill = Color32::from_rgb(18, 12, 28); vis.window_fill = Color32::from_rgb(24, 16, 36); @@ -6187,6 +6189,18 @@ mod tests { panic!("media job never finished"); } + #[test] + fn style_stays_dark_when_the_system_theme_is_light() { + let ctx = egui::Context::default(); + setup_style(&ctx); + let input = egui::RawInput { system_theme: Some(egui::Theme::Light), ..Default::default() }; + let _ = ctx.run(input, |ctx| { + let visuals = ctx.style().visuals.clone(); + assert!(visuals.dark_mode); + assert_eq!(visuals.panel_fill, Color32::from_rgb(18, 12, 28)); + }); + } + #[test] fn media_jobs_drop_stale_results_and_survive_panics() { let media = Arc::new(Mutex::new(MediaState::default()));