1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

egui_demo_app: fall back to dark mode if there is no system preference

This commit is contained in:
Emil Ernerfeldt
2022-04-30 17:17:36 +02:00
parent 3ace620f37
commit 462ad5a7f6

View File

@@ -109,6 +109,12 @@ impl WrapApp {
}
}
if cc.integration_info.prefer_dark_mode == Some(false) {
cc.egui_ctx.set_visuals(egui::Visuals::light()); // use light mode if explicitly asked for
} else {
cc.egui_ctx.set_visuals(egui::Visuals::dark()); // use dark mode if there is no preference, or the preference is dark mode
}
slf
}