#[non_exhaustive]pub struct ResolvedSwitchTheme {Show 22 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>,
pub unchecked_track_border_color: Option<Rgba>,
pub checked_track_border_color: Option<Rgba>,
pub disabled_unchecked_track_border_color: Option<Rgba>,
pub disabled_checked_track_border_color: Option<Rgba>,
pub track_border_line_width: Option<f32>,
pub thumb_border_color: Option<Rgba>,
pub thumb_border_line_width: Option<f32>,
}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. A thumb
shorter than the track is centred in it; a taller one overhangs it
above and below and sits flush with its ends, as qqc2-desktop-style’s
(docs/platform-facts.md §2.21).
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.
unchecked_track_border_color: Option<Rgba>The off track’s outline, track_border_line_width wide inside the
track: WinUI’s ToggleSwitchStrokeOff, Material’s
unselected-track-outline-color, qqc2-desktop-style’s
handleBorderColor. None draws no outline, as libadwaita and
macOS (docs/platform-facts.md §2.21).
checked_track_border_color: Option<Rgba>The on track’s outline: qqc2-desktop-style’s highlightColor. None
draws none, as WinUI and Material, which outline only the off track
(docs/platform-facts.md §2.21).
disabled_unchecked_track_border_color: Option<Rgba>The off track’s outline when disabled; None, the enabled one (as
for the one below).
disabled_checked_track_border_color: Option<Rgba>The on track’s outline when disabled.
track_border_line_width: Option<f32>The track outline’s width in logical pixels, on and off; None
draws no outline.
thumb_border_color: Option<Rgba>The thumb’s outline, thumb_border_line_width wide inside the thumb,
on and off: qqc2-desktop-style’s handleBorderColor. None draws
none (docs/platform-facts.md §2.21).
thumb_border_line_width: Option<f32>The thumb outline’s width in logical pixels; None draws no outline.