commit 1a0abdc6f1c600bf06646d23393bf18431e3201c parent 827a75e8905459095729426b1762a3e8444d5b8c Author: dsp56300 <dsp56300@users.noreply.github.com> Date: Wed, 16 Mar 2022 17:10:57 +0100 add ability to edit preset name Diffstat:
M | source/jucePlugin/ui3/VirusEditor.cpp | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/source/jucePlugin/ui3/VirusEditor.cpp b/source/jucePlugin/ui3/VirusEditor.cpp @@ -58,6 +58,17 @@ namespace genericVirusUI auto* presetLoad = findComponentT<juce::Button>("PresetLoad"); presetLoad->onClick = [this] { loadPreset(); }; + + m_presetName->setEditable(false, true, true); + m_presetName->onTextChange = [this]() + { + const auto text = m_presetName->getText(); + if (text.trim().length() > 0) + { + getController().setSinglePresetName(getController().getCurrentPart(), text); + onProgramChange(); + } + }; } void VirusEditor::onProgramChange()