pub struct Slider {
pub value: f32,
pub min: f32,
pub max: f32,
/* private fields */
}Expand description
A horizontal slider — brought to the Quality Bar (matches the Switch
exemplar; see .steering/WIDGET_QUALITY_BAR.md).
- States — idle · hover (thumb grows) · pressed/dragging (grows more) · focus-visible (ring) · disabled (dimmed, inert).
- Motion — the fill + thumb track the value instantly (they follow the finger, never lag); the thumb’s grow and its hover/press/focus state-layer halo ease smoothly on their own channels.
- Elevation — the bright knob casts a soft shadow over a rounded pill track with a colored fill.
- A11y —
Role::Sliderwith the current value; drag works through the engine’s positional press (interactive-by-identity — an unwired slider still absorbs so it can’t pan a scroll view behind it).
Fields§
§value: f32§min: f32§max: f32Implementations§
Source§impl Slider
impl Slider
pub fn new(value: f32) -> Self
pub fn range(self, min: f32, max: f32, value: f32) -> Self
pub fn width(self, w: f32) -> Self
pub fn height(self, h: f32) -> Self
pub fn disabled(self) -> Self
pub fn disabled_if(self, c: bool) -> Self
pub fn track_color(self, c: Color) -> Self
pub fn fill_color(self, c: Color) -> Self
pub fn thumb_color(self, c: Color) -> Self
Trait Implementations§
Source§impl Widget for Slider
impl Widget for Slider
Source§fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
Measure under
ctx.constraints and return a size within them. Read moreSource§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Declare this widget’s children. Drives every default below.
Source§fn flex_factor(&self) -> f32
fn flex_factor(&self) -> f32
Flex weight inside Row/Column. Wrappers are transparent by default.
Auto Trait Implementations§
impl !RefUnwindSafe for Slider
impl !UnwindSafe for Slider
impl Freeze for Slider
impl Send for Slider
impl Sync for Slider
impl Unpin for Slider
impl UnsafeUnpin for Slider
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
Mutably borrows from an owned value. Read more
Source§impl<W> FocusApi for W
impl<W> FocusApi for W
Source§fn focus_node(self, node: FocusNode) -> WithFocus<Self>
fn focus_node(self, node: FocusNode) -> WithFocus<Self>
Attach a focus node. This enables focus-ring rendering and explicit
neighbor wiring.