Skip to content

Commit

Permalink
Last Hover Change (#6021)
Browse files Browse the repository at this point in the history
Clean up the tricky bits and bobs

Closes #5318
  • Loading branch information
baconpaul authored Apr 5, 2022
1 parent 4d6a25c commit af49350
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
14 changes: 12 additions & 2 deletions src/surge-xt/gui/SurgeGUIEditorValueCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,18 @@ int32_t SurgeGUIEditor::controlModifierClicked(Surge::GUI::IComponentTagValue *c
{
if (lfoDisplay->isMSEG() || lfoDisplay->isFormula())
{
auto tag = lfoDisplay->isMSEG() ? MSEG_EDITOR : FORMULA_EDITOR;
lfoDisplay->showLFODisplayPopupMenu(tag);
std::string olname = lfoDisplay->isMSEG() ? "MSEG Editor" : "Formula Editor";
std::string helpname = lfoDisplay->isMSEG() ? "mseg-editor" : "formula-editor";

auto msurl = SurgeGUIEditor::helpURLForSpecial(&(synth->storage), helpname);
auto hurl = SurgeGUIEditor::fullyResolvedHelpURL(msurl);

auto hmen = std::make_unique<Surge::Widgets::MenuTitleHelpComponent>(olname, hurl);
hmen->setSkin(currentSkin, bitmapStore);
auto contextMenu = juce::PopupMenu();
contextMenu.addCustomItem(-1, std::move(hmen));
contextMenu.showMenuAsync(popupMenuOptions(control->asJuceComponent(), false),
Surge::GUI::makeEndHoverCallback(control));
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/surge-xt/gui/overlays/LuaEditors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,8 @@ struct FormulaControlArea : public juce::Component,

editor->addHelpHeaderTo("Formula Editor", hurl, contextMenu);

contextMenu.showMenuAsync(editor->popupMenuOptions(this, false));
contextMenu.showMenuAsync(editor->popupMenuOptions(this, false),
Surge::GUI::makeEndHoverCallback(c));
}
break;
default:
Expand Down
3 changes: 2 additions & 1 deletion src/surge-xt/gui/overlays/MSEGEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3038,7 +3038,8 @@ int32_t MSEGControlRegion::controlModifierClicked(Surge::GUI::IComponentTagValue
showTypein);
}

contextMenu.showMenuAsync(sge->popupMenuOptions());
contextMenu.showMenuAsync(sge->popupMenuOptions(),
Surge::GUI::makeEndHoverCallback(pControl));
}
return 1;
}
Expand Down
3 changes: 0 additions & 3 deletions src/surge-xt/gui/widgets/LFOAndStepDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1752,9 +1752,6 @@ void LFOAndStepDisplay::shiftRight()

void LFOAndStepDisplay::mouseExit(const juce::MouseEvent &event)
{
lfoTypeHover = -1;
stepSeqShiftHover = -1;

if (overWaveform)
{
enterExitWaveform(false);
Expand Down
3 changes: 3 additions & 0 deletions src/surge-xt/gui/widgets/XMLConfiguredMenus.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ struct OscillatorMenu : public juce::Component,
}
void endHover() override
{
if (stuckHover)
return;

isHovered = false;
repaint();
}
Expand Down

0 comments on commit af49350

Please sign in to comment.