pub struct SwitchTheme {Show 15 fields
pub checked_background: Option<Rgba>,
pub unchecked_background: Option<Rgba>,
pub thumb_background: Option<Rgba>,
pub unchecked_thumb_background: Option<Rgba>,
pub track_width: Option<f32>,
pub track_height: Option<f32>,
pub thumb_diameter: Option<f32>,
pub unchecked_thumb_diameter: Option<f32>,
pub track_radius: Option<f32>,
pub disabled_opacity: Option<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§
§checked_background: Option<Rgba>Track background when the switch is on.
unchecked_background: Option<Rgba>Track background when the switch is off.
thumb_background: Option<Rgba>Thumb (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: Option<f32>Track width in logical pixels.
track_height: Option<f32>Track height in logical pixels.
thumb_diameter: Option<f32>Thumb 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: Option<f32>Track corner radius in logical pixels.
disabled_opacity: Option<f32>Opacity 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.
Implementations§
Source§impl SwitchTheme
impl SwitchTheme
Sourcepub const FIELD_NAMES: &[&str]
pub const FIELD_NAMES: &[&str]
All serialized field names for this widget theme, for TOML linting.