mirror of
https://github.com/storytold/egui.git
synced 2026-11-23 02:52:15 +01:00
egui_demo_app: fall back to dark mode if there is no system preference
This commit is contained in:
1 parent
3ace620f37
commit
462ad5a7f6
1 file changed
+6
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user