[][src]Struct iced_audio::h_slider::HSlider

pub struct HSlider<'a, Message, Renderer: Renderer> { /* fields omitted */ }

A horizontal slider GUI widget that controls a Param

An HSlider will try to fill the horizontal space of its container.

Methods

impl<'a, Message, Renderer: Renderer> HSlider<'a, Message, Renderer>[src]

pub fn new<F>(state: &'a mut State, param: &impl Param, on_change: F) -> Self where
    F: 'static + Fn((u32, Normal)) -> Message, 
[src]

Creates a new HSlider.

It expects:

  • the local State of the HSlider
  • a Param with the current and default values
  • a function that will be called when the HSlider is dragged. It receives the parameter's ID and the new Normal of the HSlider.

pub fn width(self, width: Length) -> Self[src]

Sets the width of the HSlider.

pub fn style(self, style: impl Into<Renderer::Style>) -> Self[src]

Sets the style of the HSlider.

pub fn modifier_keys(self, modifier_keys: ModifiersState) -> Self[src]

Sets the modifier keys of the HSlider.

The default modifier key is Ctrl.

pub fn modifier_scalar(self, scalar: f32) -> Self[src]

Sets the scalar to use when the user drags the slider while holding down the modifier key.

For example, a scalar of 0.5 will cause the slider to move half a pixel for every pixel the mouse moves.

The default scalar is 0.02, and the default modifier key is Ctrl.

Trait Implementations

impl<'a, Message, Renderer> From<HSlider<'a, Message, Renderer>> for Element<'a, Message, Renderer> where
    Renderer: 'a + Renderer,
    Message: 'a, 
[src]

impl<'a, Message, Renderer> Widget<Message, Renderer> for HSlider<'a, Message, Renderer> where
    Renderer: Renderer
[src]

fn hash_layout(&self, state: &mut Hasher)[src]

test

Auto Trait Implementations

impl<'a, Message, Renderer> !RefUnwindSafe for HSlider<'a, Message, Renderer>

impl<'a, Message, Renderer> !Send for HSlider<'a, Message, Renderer>

impl<'a, Message, Renderer> !Sync for HSlider<'a, Message, Renderer>

impl<'a, Message, Renderer> Unpin for HSlider<'a, Message, Renderer> where
    <Renderer as Renderer>::Style: Unpin

impl<'a, Message, Renderer> !UnwindSafe for HSlider<'a, Message, Renderer>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,