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

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

A 2D XY pad GUI widget that controls two NormalParam 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> XYPad<'a, Message, Renderer>[src]

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

Creates a new XYPad.

It expects:

  • the local State of the XYPad
  • a function that will be called when the XYPad is dragged.

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: Modifiers) -> 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> Widget<Message, Renderer> for XYPad<'a, Message, Renderer> where
    Renderer: Renderer
[src]

fn width(&self) -> Length[src]

Returns the width of the Widget.

fn height(&self) -> Length[src]

Returns the height of the Widget.

fn layout(&self, _renderer: &Renderer, limits: &Limits) -> Node[src]

Returns the Node of the Widget. Read more

fn on_event(
    &mut self,
    event: Event,
    layout: Layout<'_>,
    cursor_position: Point,
    _renderer: &Renderer,
    _clipboard: &mut dyn Clipboard,
    messages: &mut Vec<Message>
) -> Status
[src]

Processes a runtime Event. Read more

fn draw(
    &self,
    renderer: &mut Renderer,
    _defaults: &Renderer::Defaults,
    layout: Layout<'_>,
    cursor_position: Point,
    _viewport: &Rectangle
) -> Renderer::Output
[src]

Draws the Widget using the associated Renderer.

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

Computes the layout hash of the Widget. Read more

fn overlay(
    &mut self,
    _layout: Layout<'_>
) -> Option<Element<'_, Message, Renderer>>
[src]

Returns the overlay of the Widget, if there is any.

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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

pub fn vzip(self) -> V