diff --git a/src/surge-xt/gui/SurgeGUIEditor.h b/src/surge-xt/gui/SurgeGUIEditor.h index e3b1b8bf010..162b5100113 100644 --- a/src/surge-xt/gui/SurgeGUIEditor.h +++ b/src/surge-xt/gui/SurgeGUIEditor.h @@ -472,13 +472,14 @@ class SurgeGUIEditor : public Surge::GUI::IComponentTagValue::Listener, public: std::shared_ptr bitmapStore = nullptr; + // made public so that EffectChooser can get to it! + std::unique_ptr fxMenu; private: std::array, n_fx_slots + 1> vu; std::unique_ptr patchSelector; std::unique_ptr patchSelectorComment; std::unique_ptr oscMenu; - std::unique_ptr fxMenu; std::unique_ptr waveshaperSelector; std::unique_ptr waveshaperAnalysis; diff --git a/src/surge-xt/gui/widgets/EffectChooser.cpp b/src/surge-xt/gui/widgets/EffectChooser.cpp index e5dc7e1bbab..c03cb2eac9f 100644 --- a/src/surge-xt/gui/widgets/EffectChooser.cpp +++ b/src/surge-xt/gui/widgets/EffectChooser.cpp @@ -16,7 +16,9 @@ #include "RuntimeFont.h" #include "SurgeGUIEditor.h" +#include "SurgeJUCEHelpers.h" #include "SurgeImage.h" +#include "XMLConfiguredMenus.h" #include "AccessibleHelpers.h" namespace Surge @@ -255,27 +257,33 @@ void EffectChooser::mouseDown(const juce::MouseEvent &event) if (r.contains(event.getPosition())) { auto sge = firstListenerOfType(); + if (sge) { sge->effectSettingsBackgroundClick(i, this); } } } + + if (currentClicked >= 0) + { + if (event.mods.isRightButtonDown()) + { + auto sge = firstListenerOfType(); + + if (sge && sge->fxMenu) + { + sge->fxMenu->menu.showMenuAsync(juce::PopupMenu::Options()); + } + } + } } void EffectChooser::mouseUp(const juce::MouseEvent &event) { if (!hasDragged && currentClicked >= 0) { - if (event.mods.isRightButtonDown()) - { - storage->getPatch().isDirty = true; - deactivatedBitmask ^= (1 << currentClicked); - } - else - { - currentEffect = currentClicked; - } + currentEffect = currentClicked; notifyValueChanged(); }