pub struct WindowSizeClass {
pub width: WindowWidthSizeClass,
pub height: WindowHeightSizeClass,
}Expand description
The classes of a window’s width and height.
The classes say how much room a layout has, not how the window is used; posture and hinges, which would refine that, wait for the embedders to report them.
Fields§
§width: WindowWidthSizeClassThe width class.
height: WindowHeightSizeClassThe height class.
Implementations§
Source§impl WindowSizeClass
impl WindowSizeClass
Sourcepub const WIDTH_MEDIUM_LOWER_BOUND: f64 = 600.0
pub const WIDTH_MEDIUM_LOWER_BOUND: f64 = 600.0
The lower bound of WindowWidthSizeClass::Medium.
Sourcepub const WIDTH_EXPANDED_LOWER_BOUND: f64 = 840.0
pub const WIDTH_EXPANDED_LOWER_BOUND: f64 = 840.0
The lower bound of WindowWidthSizeClass::Expanded.
Sourcepub const WIDTH_LARGE_LOWER_BOUND: f64 = 1200.0
pub const WIDTH_LARGE_LOWER_BOUND: f64 = 1200.0
The lower bound of WindowWidthSizeClass::Large.
Sourcepub const WIDTH_EXTRA_LARGE_LOWER_BOUND: f64 = 1600.0
pub const WIDTH_EXTRA_LARGE_LOWER_BOUND: f64 = 1600.0
The lower bound of WindowWidthSizeClass::ExtraLarge.
Sourcepub const HEIGHT_MEDIUM_LOWER_BOUND: f64 = 480.0
pub const HEIGHT_MEDIUM_LOWER_BOUND: f64 = 480.0
The lower bound of WindowHeightSizeClass::Medium.
Sourcepub const HEIGHT_EXPANDED_LOWER_BOUND: f64 = 900.0
pub const HEIGHT_EXPANDED_LOWER_BOUND: f64 = 900.0
The lower bound of WindowHeightSizeClass::Expanded.
Sourcepub fn from_size(size: Size) -> WindowSizeClass
pub fn from_size(size: Size) -> WindowSizeClass
The class of a window of this logical size.
Sourcepub fn of(app: &mut App, context: BuildContext) -> WindowSizeClass
pub fn of(app: &mut App, context: BuildContext) -> WindowSizeClass
The class of the nearest MediaQuery’s size.
Reading it makes the caller rebuild when the window size changes.
Sourcepub fn maybe_of(app: &mut App, context: BuildContext) -> Option<WindowSizeClass>
pub fn maybe_of(app: &mut App, context: BuildContext) -> Option<WindowSizeClass>
The class of the nearest MediaQuery’s size, or None without one.
Trait Implementations§
Source§impl Clone for WindowSizeClass
impl Clone for WindowSizeClass
impl Copy for WindowSizeClass
Source§impl Debug for WindowSizeClass
impl Debug for WindowSizeClass
impl Eq for WindowSizeClass
Source§impl Hash for WindowSizeClass
impl Hash for WindowSizeClass
Source§impl PartialEq for WindowSizeClass
impl PartialEq for WindowSizeClass
impl StructuralPartialEq for WindowSizeClass
Auto Trait Implementations§
impl Forget for WindowSizeClass
impl Freeze for WindowSizeClass
impl Move 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> AnyEq for T
impl<T> AnyEq for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.