[][src]Struct iced_audio::native::ramp::Ramp

pub struct Ramp<'a, Message, Renderer: Renderer, ID> where
    ID: Debug + Copy + Clone
{ /* fields omitted */ }

A ramp GUI widget that controls a Param. It is usually used to represent the easing of a parameter between two points in time.

Implementations

impl<'a, Message, Renderer: Renderer, ID> Ramp<'a, Message, Renderer, ID> where
    ID: Debug + Copy + Clone
[src]

pub fn new<F>(
    state: &'a mut State<ID>,
    on_change: F,
    direction: RampDirection
) -> Self where
    F: 'static + Fn(ID) -> Message, 
[src]

Creates a new Ramp.

It expects:

  • the local State of the Ramp
  • a function that will be called when the Ramp is dragged.
  • the RampDirection of the Ramp, which tells if the ramp line should point Up (from bottom-left to top-right), or Down (from top-left to bottom-right)

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

Sets the width of the Ramp. The default width is Length::from(Length::Units(30)).

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

Sets the height of the Ramp. The default height is Length::from(Length::Units(20)).

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

Sets the style of the Ramp.

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

Sets how much the Normal value will change for the Ramp per y pixel movement of the mouse.

The default value is 0.008

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

Sets the modifier keys of the Ramp.

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 Ramps while holding down the modifier key. This is multiplied to the value set by Ramp::scalar() (which the default is 0.008).

For example, a modifier_scalar of 0.5 will cause the ramp to move half as fast when the modifier key is down.

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

Trait Implementations

impl<'a, Message, Renderer, ID> From<Ramp<'a, Message, Renderer, ID>> for Element<'a, Message, Renderer> where
    Renderer: 'a + Renderer,
    Message: 'a,
    ID: 'a + Debug + Copy + Clone
[src]

impl<'a, Message, Renderer, ID> Widget<Message, Renderer> for Ramp<'a, Message, Renderer, ID> where
    Renderer: Renderer,
    ID: Debug + Copy + Clone
[src]

Auto Trait Implementations

impl<'a, Message, Renderer, ID> !RefUnwindSafe for Ramp<'a, Message, Renderer, ID>

impl<'a, Message, Renderer, ID> !Send for Ramp<'a, Message, Renderer, ID>

impl<'a, Message, Renderer, ID> !Sync for Ramp<'a, Message, Renderer, ID>

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

impl<'a, Message, Renderer, ID> !UnwindSafe for Ramp<'a, Message, Renderer, ID>

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> SetParameter for T

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>,