pub struct WindowSizeClass {
pub width: WidthClass,
pub height: HeightClass,
}Expand description
Snapshot of the current window’s size category.
The LayoutEngine updates the WindowSizeClass default local every time
the window is resized, so UI can read it via window_size_class() during
composition.
Fields§
§width: WidthClass§height: HeightClassImplementations§
Source§impl WindowSizeClass
impl WindowSizeClass
Sourcepub fn is_expanded_width(&self) -> bool
pub fn is_expanded_width(&self) -> bool
true when there is enough horizontal space for multi-pane layouts.
Sourcepub fn is_at_least_medium_width(&self) -> bool
pub fn is_at_least_medium_width(&self) -> bool
true when there is enough horizontal space for a two-pane layout
(list + detail). Per M3 this is Medium or wider.
Trait Implementations§
Source§impl Clone for WindowSizeClass
impl Clone for WindowSizeClass
Source§fn clone(&self) -> WindowSizeClass
fn clone(&self) -> WindowSizeClass
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for WindowSizeClass
Source§impl Debug for WindowSizeClass
impl Debug for WindowSizeClass
Source§impl Default for WindowSizeClass
impl Default for WindowSizeClass
Source§fn default() -> WindowSizeClass
fn default() -> WindowSizeClass
Returns the “default value” for a type. Read more
impl Eq for WindowSizeClass
Source§impl Hash for WindowSizeClass
impl Hash for WindowSizeClass
Source§impl PartialEq for WindowSizeClass
impl PartialEq for WindowSizeClass
Source§fn eq(&self, other: &WindowSizeClass) -> bool
fn eq(&self, other: &WindowSizeClass) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WindowSizeClass
Auto Trait Implementations§
impl Freeze for WindowSizeClass
impl RefUnwindSafe for WindowSizeClass
impl Send for WindowSizeClass
impl Sync for WindowSizeClass
impl Unpin for WindowSizeClass
impl UnsafeUnpin for WindowSizeClass
impl UnwindSafe for WindowSizeClass
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
Mutably borrows from an owned value. Read more