Browse Source

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

pull/1552/head
Emil Ernerfeldt 3 years ago
parent
commit
462ad5a7f6
  1. 6
      egui_demo_app/src/wrap_app.rs

6
egui_demo_app/src/wrap_app.rs

@ -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…
Cancel
Save