Refactor GUIs to use param's own default value

This removes the need to pass a lot of these `ParamSetter`s and
`GuiContext`s around. We also don't need explicit events to reset a
parameter anymore since you can get this information from the parameter
itself.
This commit is contained in:
Robbert van der Helm
2022-03-21 13:09:51 +01:00
parent a844051054
commit f084f14095
18 changed files with 54 additions and 168 deletions

View File

@@ -85,13 +85,9 @@ impl IcedEditor for CrispEditor {
}
fn view(&mut self) -> Element<'_, Self::Message> {
GenericUi::new(
&mut self.generic_ui_state,
self.params.as_ref(),
self.context.as_ref(),
)
.pad_scrollbar()
.map(Message::ParamUpdate)
GenericUi::new(&mut self.generic_ui_state, self.params.as_ref())
.pad_scrollbar()
.map(Message::ParamUpdate)
}
fn background_color(&self) -> nih_plug_iced::Color {