Add flag to emulate mobile during preview

Since the is_mobile check was moved to compile-time instead of runtime
in 0a6a441041, we need a way to override
the check when previewing using the 'mobile' flag.

Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
kernelkind
2024-05-03 13:10:56 -04:00
committed by William Casarin
parent f9d6161500
commit aacc41e4c2
4 changed files with 34 additions and 6 deletions

View File

@@ -38,7 +38,13 @@ pub fn padding<R>(
}
#[inline]
#[allow(unreachable_code)]
pub fn is_mobile(_ctx: &egui::Context) -> bool {
#[cfg(feature = "emulate_mobile")]
{
return true;
}
#[cfg(any(target_os = "android", target_os = "ios"))]
{
true