Skip to content

Commit

Permalink
Replace RMB bypass in FX grid with FX presets menu (#5929)
Browse files Browse the repository at this point in the history
Massive QOL improvement, this. Closes #5613.
  • Loading branch information
mkruselj authored Mar 4, 2022
1 parent 901b73f commit e8cf79b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/surge-xt/gui/SurgeGUIEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,14 @@ class SurgeGUIEditor : public Surge::GUI::IComponentTagValue::Listener,

public:
std::shared_ptr<SurgeImageStore> bitmapStore = nullptr;
// made public so that EffectChooser can get to it!
std::unique_ptr<Surge::Widgets::FxMenu> fxMenu;

private:
std::array<std::unique_ptr<Surge::Widgets::VuMeter>, n_fx_slots + 1> vu;
std::unique_ptr<Surge::Widgets::PatchSelector> patchSelector;
std::unique_ptr<Surge::Widgets::PatchSelectorCommentTooltip> patchSelectorComment;
std::unique_ptr<Surge::Widgets::OscillatorMenu> oscMenu;
std::unique_ptr<Surge::Widgets::FxMenu> fxMenu;
std::unique_ptr<Surge::Widgets::WaveShaperSelector> waveshaperSelector;
std::unique_ptr<Surge::Widgets::Switch> waveshaperAnalysis;

Expand Down
26 changes: 17 additions & 9 deletions src/surge-xt/gui/widgets/EffectChooser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

#include "RuntimeFont.h"
#include "SurgeGUIEditor.h"
#include "SurgeJUCEHelpers.h"
#include "SurgeImage.h"
#include "XMLConfiguredMenus.h"
#include "AccessibleHelpers.h"

namespace Surge
Expand Down Expand Up @@ -255,27 +257,33 @@ void EffectChooser::mouseDown(const juce::MouseEvent &event)
if (r.contains(event.getPosition()))
{
auto sge = firstListenerOfType<SurgeGUIEditor>();

if (sge)
{
sge->effectSettingsBackgroundClick(i, this);
}
}
}

if (currentClicked >= 0)
{
if (event.mods.isRightButtonDown())
{
auto sge = firstListenerOfType<SurgeGUIEditor>();

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();
}

Expand Down

0 comments on commit e8cf79b

Please sign in to comment.