egui_demo_app: fall back to dark mode if there is no system preference
This commit is contained in:
parent
3ace620f37
commit
462ad5a7f6
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue