#[repr(C)]pub enum SystemMetricRef {
ButtonRadius = 0,
ButtonPaddingHorizontal = 1,
ButtonPaddingVertical = 2,
ButtonBorderWidth = 3,
TitlebarHeight = 4,
TitlebarButtonWidth = 5,
TitlebarPadding = 6,
SafeAreaTop = 7,
SafeAreaBottom = 8,
SafeAreaLeft = 9,
SafeAreaRight = 10,
}Expand description
Reference to a specific system metric value. These are resolved at runtime based on the user’s system preferences.
CSS syntax: system:button-padding, system:button-radius, system:titlebar-height, etc.
Variants§
ButtonRadius = 0
Button corner radius (system:button-radius)
ButtonPaddingHorizontal = 1
Button horizontal padding (system:button-padding-horizontal)
ButtonPaddingVertical = 2
Button vertical padding (system:button-padding-vertical)
ButtonBorderWidth = 3
Button border width (system:button-border-width)
TitlebarHeight = 4
Titlebar height (system:titlebar-height)
TitlebarButtonWidth = 5
Titlebar button area width (system:titlebar-button-width)
TitlebarPadding = 6
Titlebar horizontal padding (system:titlebar-padding)
SafeAreaTop = 7
Safe area top inset for notched devices (system:safe-area-top)
SafeAreaBottom = 8
Safe area bottom inset (system:safe-area-bottom)
SafeAreaLeft = 9
Safe area left inset (system:safe-area-left)
SafeAreaRight = 10
Safe area right inset (system:safe-area-right)
Implementations§
Source§impl SystemMetricRef
impl SystemMetricRef
Sourcepub fn resolve(&self, metrics: &SystemMetrics) -> Option<PixelValue>
pub fn resolve(&self, metrics: &SystemMetrics) -> Option<PixelValue>
Resolve this system metric reference against actual system metrics.
Sourcepub fn as_css_str(&self) -> &'static str
pub fn as_css_str(&self) -> &'static str
Returns the CSS string representation of this system metric reference.
Sourcepub fn from_css_str(s: &str) -> Option<Self>
pub fn from_css_str(s: &str) -> Option<Self>
Parse a system metric reference from a CSS string (without the “system:” prefix).
Trait Implementations§
Source§impl Clone for SystemMetricRef
impl Clone for SystemMetricRef
Source§fn clone(&self) -> SystemMetricRef
fn clone(&self) -> SystemMetricRef
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more