mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
egui_demo_app: fall back to dark mode if there is no system preference
This commit is contained in:
@@ -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
|
slf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user