pub struct Environment {Show 15 fields
pub window: (f32, f32),
pub safe_area: Insets,
pub title_bar: Insets,
pub keyboard_height: f32,
pub keyboard_duration: f32,
pub color_scheme: ColorScheme,
pub font_scale: f32,
pub rtl: bool,
pub reduce_motion: bool,
pub pixel_ratio: f32,
pub screen_reader: bool,
pub os: Os,
pub os_version: (u16, u16),
pub idiom: Idiom,
pub locale: Locale,
}Expand description
What the platform knows about the surface.
Fields§
§window: (f32, f32)Size of the surface in points.
safe_area: InsetsInsets not covered by system UI (notch, home indicator, title bar).
title_bar: InsetsThe title bar’s area while the app hides it (desktops,
crate::desktop::TitleBarStyle::Hidden): top is its height,
left and right the widths the system’s window controls take at
its ends (bottom is 0); all 0 while the system shows its title
bar.
keyboard_height: f32Height of the software keyboard over the surface; 0 when hidden.
keyboard_duration: f32Duration of the keyboard’s show / hide animation in seconds.
color_scheme: ColorSchemeLight or dark appearance.
font_scale: f32Preferred text size relative to the default (1.0).
rtl: boolThe user’s language is written right to left.
reduce_motion: boolThe user asked for less motion (iOS Reduce Motion, Android’s animator duration scale at 0).
pixel_ratio: f32Device pixels per point.
screen_reader: boolA screen reader runs (VoiceOver, TalkBack).
os: OsThe operating system.
os_version: (u16, u16)The OS version: major and minor (iOS, desktops), Android’s API level and 0.
idiom: IdiomThe kind of device.
locale: LocaleThe user’s locale (number and date formats: Intl’s default).
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more