Struct nih_plug_iced::widgets::param_slider::ParamSlider
source · pub struct ParamSlider<'a, P: Param> { /* private fields */ }
Expand description
A slider that integrates with NIH-plug’s Param
types.
TODO: There are currently no styling options at all TODO: Handle scrolling for steps (and shift+scroll for smaller steps?)
Implementations§
source§impl<'a, P: Param> ParamSlider<'a, P>
impl<'a, P: Param> ParamSlider<'a, P>
sourcepub fn new(state: &'a mut State, param: &'a P) -> Self
pub fn new(state: &'a mut State, param: &'a P) -> Self
Creates a new ParamSlider
for the given parameter.
sourcepub fn width(self, width: Length) -> Self
pub fn width(self, width: Length) -> Self
Sets the width of the ParamSlider
.
sourcepub fn height(self, height: Length) -> Self
pub fn height(self, height: Length) -> Self
Sets the height of the ParamSlider
.
sourcepub fn text_size(self, size: u16) -> Self
pub fn text_size(self, size: u16) -> Self
Sets the text size of the ParamSlider
.
sourcepub fn font(self, font: Font) -> Self
pub fn font(self, font: Font) -> Self
Sets the font of the ParamSlider
.
source§impl<'a, P: Param> ParamSlider<'a, P>
impl<'a, P: Param> ParamSlider<'a, P>
sourcepub fn map<Message, F>(self, f: F) -> Element<'a, Message>where
Message: 'static,
F: Fn(ParamMessage) -> Message + 'static,
pub fn map<Message, F>(self, f: F) -> Element<'a, Message>where Message: 'static, F: Fn(ParamMessage) -> Message + 'static,
Convert this ParamSlider
into an [Element
] with the correct message. You should have a
variant on your own message type that wraps around ParamMessage
so you can forward those
messages to
IcedEditor::handle_param_message()
.
Trait Implementations§
source§impl<'a, P: Param> From<ParamSlider<'a, P>> for Element<'a, ParamMessage>
impl<'a, P: Param> From<ParamSlider<'a, P>> for Element<'a, ParamMessage>
source§fn from(widget: ParamSlider<'a, P>) -> Self
fn from(widget: ParamSlider<'a, P>) -> Self
Converts to this type from the input type.
source§impl<'a, P: Param> Widget<ParamMessage, Renderer<Backend>> for ParamSlider<'a, P>
impl<'a, P: Param> Widget<ParamMessage, Renderer<Backend>> for ParamSlider<'a, P>
source§fn on_event(
&mut self,
event: Event,
layout: Layout<'_>,
cursor_position: Point,
renderer: &Renderer,
clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, ParamMessage>
) -> Status
fn on_event( &mut self, event: Event, layout: Layout<'_>, cursor_position: Point, renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, ParamMessage> ) -> Status
Processes a runtime [
Event
]. Read moresource§fn mouse_interaction(
&self,
layout: Layout<'_>,
cursor_position: Point,
_viewport: &Rectangle,
_renderer: &Renderer
) -> Interaction
fn mouse_interaction( &self, layout: Layout<'_>, cursor_position: Point, _viewport: &Rectangle, _renderer: &Renderer ) -> Interaction
Auto Trait Implementations§
impl<'a, P> !RefUnwindSafe for ParamSlider<'a, P>
impl<'a, P> Send for ParamSlider<'a, P>where P: Sync,
impl<'a, P> Sync for ParamSlider<'a, P>where P: Sync,
impl<'a, P> Unpin for ParamSlider<'a, P>
impl<'a, P> !UnwindSafe for ParamSlider<'a, P>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more