pub enum Density {
Compact,
Standard,
Comfortable,
}Expand description
Desktop density adjustment for a component’s visual size.
Variants§
Compact
Tighter visual spacing for dense desktop layouts.
Standard
Default Material visual density.
Comfortable
Roomier visual spacing.
Implementations§
Source§impl Density
impl Density
Sourcepub fn visual_size(self, baseline: f32) -> f32
pub fn visual_size(self, baseline: f32) -> f32
Applies this density’s delta to a baseline visual size in logical units.
Non-finite or non-positive baselines return 0.0.
Sourcepub fn interactive_size(self, baseline: f32) -> f32
pub fn interactive_size(self, baseline: f32) -> f32
The target stays at least 48 logical units even for dense visuals.
Trait Implementations§
impl Copy for Density
Source§impl<'de> Deserialize<'de> for Density
impl<'de> Deserialize<'de> for Density
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Density
impl StructuralPartialEq for Density
Auto Trait Implementations§
impl Forget for Density
impl Freeze for Density
impl Move for Density
impl RefUnwindSafe for Density
impl Send for Density
impl Sync for Density
impl Unpin for Density
impl UnsafeUnpin for Density
impl UnwindSafe for Density
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.