commit 0a6a44104131e2ec29286e51a800d05471e1a150 parent 28e2e7edd53fdf62636380a102b953ee52654704 Author: William Casarin <jb55@jb55.com> Date: Mon, 29 Apr 2024 11:00:56 -0700 simplify is_mobile check Just base it on the current compile target Signed-off-by: William Casarin <jb55@jb55.com> Diffstat:
M | src/ui/mod.rs | | | 14 | ++++++++++---- |
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/ui/mod.rs b/src/ui/mod.rs @@ -36,8 +36,14 @@ pub fn padding<R>( .show(ui, add_contents) } -pub fn is_mobile(ctx: &egui::Context) -> bool { - //true - let screen_size = ctx.screen_rect().size(); - screen_size.x < 550.0 +#[inline] +pub fn is_mobile(_ctx: &egui::Context) -> bool { + #[cfg(any(target_os = "android", target_os = "ios"))] + { + true + } + #[cfg(not(any(target_os = "android", target_os = "ios")))] + { + false + } }