pub enum SheetHeight {
OneThird,
Half,
TwoThirds,
Ratio(f32),
Pixels(f32),
}Expand description
The vertical size a bottom sheet should occupy, relative to the window.
Use the named variants for canonical proportions; use SheetHeight::Ratio
for arbitrary fractions (clamped to 0.0..=1.0); use
SheetHeight::Pixels for a fixed pixel height independent of window
size (discouraged for responsive apps).
Variants§
OneThird
Half
TwoThirds
Ratio(f32)
Arbitrary fraction of window height. Values outside 0.0..=1.0 are
clamped by the engine.
Pixels(f32)
Fixed pixel height. Only use when the content has a natural size that does not scale with the window.
Implementations§
Source§impl SheetHeight
impl SheetHeight
Sourcepub const DEFAULT: SheetHeight = SheetHeight::OneThird
pub const DEFAULT: SheetHeight = SheetHeight::OneThird
The default height — one-third of the window. Matches the canonical “drawer from the bottom” feel without dominating the screen.
Sourcepub fn as_ratio(self) -> Option<f32>
pub fn as_ratio(self) -> Option<f32>
Resolve to a fraction of the window, if this variant expresses one.
Returns None for SheetHeight::Pixels.
Trait Implementations§
Source§impl Clone for SheetHeight
impl Clone for SheetHeight
Source§fn clone(&self) -> SheetHeight
fn clone(&self) -> SheetHeight
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 moreSource§impl Debug for SheetHeight
impl Debug for SheetHeight
Source§impl PartialEq for SheetHeight
impl PartialEq for SheetHeight
Source§fn eq(&self, other: &SheetHeight) -> bool
fn eq(&self, other: &SheetHeight) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for SheetHeight
impl StructuralPartialEq for SheetHeight
Auto Trait Implementations§
impl Freeze for SheetHeight
impl RefUnwindSafe for SheetHeight
impl Send for SheetHeight
impl Sync for SheetHeight
impl Unpin for SheetHeight
impl UnsafeUnpin for SheetHeight
impl UnwindSafe for SheetHeight
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