[−][src]Struct iced_web::widget::slider::Slider
An horizontal bar and a handle that selects a single value from a range of values.
A Slider
will try to fill the horizontal space of its container.
The Slider
range of numeric values is generic and its step size defaults
to 1 unit.
Example
pub enum Message { SliderChanged(f32), } let state = &mut slider::State::new(); let value = 50.0; Slider::new(state, 0.0..=100.0, value, Message::SliderChanged);
Implementations
impl<'a, T, Message> Slider<'a, T, Message> where
T: Copy + From<u8> + PartialOrd,
[src]
T: Copy + From<u8> + PartialOrd,
pub fn new<F>(
state: &'a mut State,
range: RangeInclusive<T>,
value: T,
on_change: F
) -> Self where
F: 'static + Fn(T) -> Message,
[src]
state: &'a mut State,
range: RangeInclusive<T>,
value: T,
on_change: F
) -> Self where
F: 'static + Fn(T) -> Message,
Creates a new Slider
.
It expects:
pub fn width(self, width: Length) -> Self
[src]
Sets the width of the Slider
.
pub fn style(self, style: impl Into<Box<dyn StyleSheet>>) -> Self
[src]
Sets the style of the Slider
.
pub fn step(self, step: T) -> Self
[src]
Sets the step size of the Slider
.
Trait Implementations
impl<'a, T, Message> From<Slider<'a, T, Message>> for Element<'a, Message> where
T: 'static + Copy + Into<f64> + FromPrimitive,
Message: 'static,
[src]
T: 'static + Copy + Into<f64> + FromPrimitive,
Message: 'static,
impl<'a, T, Message> Widget<Message> for Slider<'a, T, Message> where
T: 'static + Copy + Into<f64> + FromPrimitive,
Message: 'static,
[src]
T: 'static + Copy + Into<f64> + FromPrimitive,
Message: 'static,
Auto Trait Implementations
impl<'a, T, Message> !RefUnwindSafe for Slider<'a, T, Message>
impl<'a, T, Message> !Send for Slider<'a, T, Message>
impl<'a, T, Message> !Sync for Slider<'a, T, Message>
impl<'a, T, Message> Unpin for Slider<'a, T, Message> where
T: Unpin,
T: Unpin,
impl<'a, T, Message> !UnwindSafe for Slider<'a, T, Message>
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
fn convert_into(self) -> U
[src]
fn convert_unclamped_into(self) -> U
[src]
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,