#[non_exhaustive]pub struct ResolvedSwitchTheme {Show 15 fields
pub checked_background: Rgba,
pub unchecked_background: Rgba,
pub thumb_background: Rgba,
pub unchecked_thumb_background: Option<Rgba>,
pub track_width: f32,
pub track_height: f32,
pub thumb_diameter: f32,
pub unchecked_thumb_diameter: Option<f32>,
pub track_radius: f32,
pub disabled_opacity: f32,
pub hover_checked_background: Option<Rgba>,
pub hover_unchecked_background: Option<Rgba>,
pub disabled_checked_background: Option<Rgba>,
pub disabled_unchecked_background: Option<Rgba>,
pub disabled_thumb_color: Option<Rgba>,
}Expand description
Toggle switch track, thumb, geometry, and interactive states.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.checked_background: RgbaTrack background when the switch is on.
unchecked_background: RgbaTrack background when the switch is off.
thumb_background: RgbaThumb (knob) color; while the switch is off, unchecked_thumb_background
where the theme states one.
unchecked_thumb_background: Option<Rgba>Thumb color while the switch is off, where the platform colours it
apart: Material’s outline, WinUI’s TextFillColorSecondary,
libadwaita’s $slider_color. None where the thumb is one colour in
both states, thumb_background (docs/platform-facts.md §2.21).
track_width: f32Track width in logical pixels.
track_height: f32Track height in logical pixels.
thumb_diameter: f32Thumb diameter in logical pixels; while the switch is off,
unchecked_thumb_diameter where the theme states one.
unchecked_thumb_diameter: Option<f32>Thumb diameter while the switch is off, in logical pixels, where the
platform sizes it apart: Material’s is 16 off, 24 on. None where the
thumb is one size in both states, thumb_diameter
(docs/platform-facts.md §2.21).
track_radius: f32Track corner radius in logical pixels.
disabled_opacity: f32Opacity multiplier when disabled (0.0-1.0), applied to the whole
widget on top of its disabled colours (see
ThemeDefaults::disabled_opacity).
hover_checked_background: Option<Rgba>Track hover color when checked (on).
hover_unchecked_background: Option<Rgba>Track hover color when unchecked (off).
disabled_checked_background: Option<Rgba>Track color when disabled and checked; None, the enabled colour (as
for the two below).
disabled_unchecked_background: Option<Rgba>Track color when disabled and unchecked.
disabled_thumb_color: Option<Rgba>Thumb color when disabled.