pub struct SliderStyle {Show 22 fields
pub track: Color,
pub track_hovered: Color,
pub active_track: Color,
pub active_track_hovered: Color,
pub thumb: Color,
pub thumb_hovered: Color,
pub thumb_pressed: Color,
pub disabled_track: Color,
pub disabled_active_track: Color,
pub disabled_thumb: Color,
pub tick: Color,
pub border: Border,
pub focus_ring: Border,
pub horizontal_width: f32,
pub horizontal_height: f32,
pub vertical_width: f32,
pub vertical_height: f32,
pub track_thickness: f32,
pub thumb_size: f32,
pub thumb_border_offset: f32,
pub focus_ring_offset: f32,
pub disabled_opacity: f32,
}Expand description
Resolved slider colors, borders, and logical-pixel geometry.
Geometry is not validated. disabled_opacity is retained for compatibility
but is not currently read; disabled colors already encode their alpha.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{SliderSize, SliderStyle};
let style = SliderStyle::from_theme(Theme::dark(), SliderSize::Compact);
assert_eq!((style.horizontal_width, style.vertical_height), (180.0, 120.0));
assert_eq!(style.thumb_size, 14.0);Fields§
§track: ColorResting inactive track fill.
track_hovered: ColorHovered inactive track fill.
active_track: ColorResting active-range fill.
active_track_hovered: ColorHovered or dragged active-range fill.
thumb: ColorResting thumb fill.
thumb_hovered: ColorHovered thumb fill.
thumb_pressed: ColorPressed or dragged thumb fill.
disabled_track: ColorDisabled inactive-track fill.
disabled_active_track: ColorDisabled active-range fill.
disabled_thumb: ColorDisabled thumb fill.
tick: ColorTick-mark color.
border: BorderBorder painted around each thumb.
focus_ring: BorderBorder painted around complete widget bounds while focused.
horizontal_width: f32Horizontal intrinsic width in logical pixels.
horizontal_height: f32Horizontal intrinsic height in logical pixels.
vertical_width: f32Vertical intrinsic width in logical pixels.
vertical_height: f32Vertical intrinsic height in logical pixels.
track_thickness: f32Track thickness in logical pixels.
thumb_size: f32Square thumb width/height in logical pixels.
thumb_border_offset: f32Gap between thumb fill and border ring; border width is added on top.
focus_ring_offset: f32Focus-ring inflation beyond widget bounds in logical pixels.
disabled_opacity: f32Reserved compatibility value; the current painter does not read it.
Implementations§
Source§impl SliderStyle
impl SliderStyle
Sourcepub fn from_theme(theme: Theme, size: SliderSize) -> Self
pub fn from_theme(theme: Theme, size: SliderSize) -> Self
Resolves slider colors and geometry from a theme and built-in size.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{SliderSize, SliderStyle};
let style = SliderStyle::from_theme(Theme::default(), SliderSize::Default);
assert_eq!((style.horizontal_width, style.horizontal_height), (260.0, 28.0));
assert_eq!((style.track_thickness, style.thumb_size), (4.0, 16.0));Trait Implementations§
Source§impl Clone for SliderStyle
impl Clone for SliderStyle
Source§fn clone(&self) -> SliderStyle
fn clone(&self) -> SliderStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SliderStyle
impl Debug for SliderStyle
Source§impl Default for SliderStyle
impl Default for SliderStyle
Source§impl PartialEq for SliderStyle
impl PartialEq for SliderStyle
impl StructuralPartialEq for SliderStyle
Auto Trait Implementations§
impl Freeze for SliderStyle
impl RefUnwindSafe for SliderStyle
impl Send for SliderStyle
impl Sync for SliderStyle
impl Unpin for SliderStyle
impl UnwindSafe for SliderStyle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.