[][src]Struct iced_audio::native::xy_pad::XYPad

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

A 2D XY pad GUI widget that controls two Param parameters at once. One in the x coordinate and one in the y coordinate.

an XYPad will try to fill the space of its container while keeping a square aspect ratio.

Implementations

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

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

Creates a new XYPad.

It expects:

  • the local State of the XYPad
  • a Param with the current and default values for the x coordinate
  • a Param with the current and default values for the y coordinate
  • a function that will be called when the XYPad is dragged. It receives the parameter's ID and the new Normal of the XYPad. ID is a user supplied type. It can be an enum, u32, i32, String, etc. Each parameter must have a unique ID value!

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

Sets the size of the XYPad.

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

Sets the style of the XYPad.

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

Sets the modifier keys of the XYPad.

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, ID> From<XYPad<'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 XYPad<'a, Message, Renderer, ID> where
    Renderer: Renderer,
    ID: Debug + Copy + Clone
[src]

Auto Trait Implementations

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

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

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

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

impl<'a, Message, Renderer, ID> !UnwindSafe for XYPad<'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>,