pub enum InputProfile {
Desktop,
MobileIOS,
MobileAndroid,
MobileOther,
}Expand description
Where keyboard / pointer events originate and how text entry should behave.
Variants§
Desktop
Physical keyboard + precise pointer (mouse / trackpad). The default. No on-screen keyboard.
MobileIOS
iPhone / iPad / iPad-mode Safari. Touch primary, no physical keyboard. On-screen keyboard renders with iOS-style chrome (rounded keys, light surface, blue accent).
MobileAndroid
Android phone or tablet (Chrome / Firefox / Samsung Internet). On-screen keyboard renders with Material-style chrome (flatter keys, system accent).
MobileOther
Touch device we can’t otherwise classify — e.g. a Linux tablet. On-screen keyboard renders with a neutral default.
Implementations§
Source§impl InputProfile
impl InputProfile
Sourcepub fn is_mobile_touch(self) -> bool
pub fn is_mobile_touch(self) -> bool
true when the profile implies the user has no physical keyboard
and the on-screen keyboard should be available.
Sourcepub fn recommended_ux_scale(self) -> f64
pub fn recommended_ux_scale(self) -> f64
Recommended crate::ux_scale multiplier for this profile.
1.0 for desktop; ~1.7 for mobile touch (phones held at
arm’s length need ~44 px touch targets and ~17 px body text,
which is roughly 1.7× what reads well on a desktop monitor).
Apps that want a different feel can override with
crate::ux_scale::set_ux_scale after the profile is
applied — accessibility settings, for example.
Trait Implementations§
Source§impl Clone for InputProfile
impl Clone for InputProfile
Source§fn clone(&self) -> InputProfile
fn clone(&self) -> InputProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InputProfile
Source§impl Debug for InputProfile
impl Debug for InputProfile
impl Eq for InputProfile
Source§impl PartialEq for InputProfile
impl PartialEq for InputProfile
Source§fn eq(&self, other: &InputProfile) -> bool
fn eq(&self, other: &InputProfile) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for InputProfile
Auto Trait Implementations§
impl Freeze for InputProfile
impl RefUnwindSafe for InputProfile
impl Send for InputProfile
impl Sync for InputProfile
impl Unpin for InputProfile
impl UnsafeUnpin for InputProfile
impl UnwindSafe for InputProfile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more