Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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()));
Expand Down
Loading