pub enum WidthClass {
Compact,
Medium,
Expanded,
Large,
ExtraLarge,
}Expand description
How wide a window is, in coarse buckets (docs/size-classes.md).
The breakpoints are Android’s window size classes, in density-independent points, and they are
used verbatim on every backend rather than per-platform. One table means one answer: a 700pt
window is WidthClass::Medium on a Mac, in a browser, and on a tablet, so an app that lays
out from the class gets the same layout at the same size everywhere. Apple publishes only two
buckets (compact/regular); those map onto this table rather than replacing it, with
WidthClass::Compact the compact one and everything above it regular.
Variants§
Compact
< 600dp: a phone in portrait. One pane at a time.
Medium
600–839dp: a tablet in portrait, a narrow desktop window.
Expanded
840–1199dp: a tablet in landscape, a typical desktop window.
Large
1200–1599dp: a large desktop window.
ExtraLarge
≥ 1600dp: a maximized window on a big display.
Trait Implementations§
Source§impl Clone for WidthClass
impl Clone for WidthClass
Source§fn clone(&self) -> WidthClass
fn clone(&self) -> WidthClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more