Struct nih_plug_iced::widgets::generic_ui::GenericUi
source · pub struct GenericUi<'a, W: ParamWidget> { /* private fields */ }
Expand description
A list of scrollable widgets for every paramter in a Params
object. The ParamWidget
type
determines what widget to use for this.
TODO: There’s no way to configure the individual widgets.
Implementations§
source§impl<'a, W> GenericUi<'a, W>where
W: ParamWidget,
impl<'a, W> GenericUi<'a, W>where W: ParamWidget,
sourcepub fn new(state: &'a mut State<W>, params: Arc<dyn Params>) -> Self
pub fn new(state: &'a mut State<W>, params: Arc<dyn Params>) -> Self
Creates a new GenericUi
for all provided parameters.
sourcepub fn max_height(self, height: u32) -> Self
pub fn max_height(self, height: u32) -> Self
Sets the maximum height of the GenericUi
.
sourcepub fn pad_scrollbar(self) -> Self
pub fn pad_scrollbar(self) -> Self
Include additional room on the right for the scroll bar.
source§impl<'a, W: ParamWidget> GenericUi<'a, W>
impl<'a, W: ParamWidget> GenericUi<'a, W>
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 GenericUi
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, W> From<GenericUi<'a, W>> for Element<'a, ParamMessage>where
W: ParamWidget,
impl<'a, W> From<GenericUi<'a, W>> for Element<'a, ParamMessage>where W: ParamWidget,
source§impl<'a, W> Widget<ParamMessage, Renderer<Backend>> for GenericUi<'a, W>where
W: ParamWidget,
impl<'a, W> Widget<ParamMessage, Renderer<Backend>> for GenericUi<'a, W>where W: ParamWidget,
source§fn draw(
&self,
renderer: &mut Renderer,
style: &Style,
layout: Layout<'_>,
cursor_position: Point,
viewport: &Rectangle
)
fn draw( &self, renderer: &mut Renderer, style: &Style, layout: Layout<'_>, cursor_position: Point, viewport: &Rectangle )
Draws the [
Widget
] using the associated Renderer
.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 more§fn mouse_interaction(
&self,
_layout: Layout<'_>,
_cursor_position: Point,
_viewport: &Rectangle<f32>,
_renderer: &Renderer
) -> Interaction
fn mouse_interaction( &self, _layout: Layout<'_>, _cursor_position: Point, _viewport: &Rectangle<f32>, _renderer: &Renderer ) -> Interaction
Auto Trait Implementations§
impl<'a, W> !RefUnwindSafe for GenericUi<'a, W>
impl<'a, W> Send for GenericUi<'a, W>where W: Send, <W as ParamWidget>::State: Send,
impl<'a, W> Sync for GenericUi<'a, W>where W: Sync, <W as ParamWidget>::State: Send + Sync,
impl<'a, W> Unpin for GenericUi<'a, W>where W: Unpin,
impl<'a, W> !UnwindSafe for GenericUi<'a, W>
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