Skip to content

Commit

Permalink
TypeAhead focusLost equivalent to cancel event (#5244)
Browse files Browse the repository at this point in the history
CLoses #5240
  • Loading branch information
baconpaul authored Oct 13, 2021
1 parent cb26de8 commit c239cad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/surge-xt/gui/widgets/TypeAheadTextEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,5 +217,11 @@ void TypeAhead::colourChanged()
if (isColourSpecified(ColourIds::borderid))
lbox->setColour(juce::ListBox::ColourIds::outlineColourId, findColour(ColourIds::borderid));
}
void TypeAhead::focusLost(juce::Component::FocusChangeType type)
{
lbox->setVisible(false);
for (auto l : taList)
l->typeaheadCanceled();
}
} // namespace Widgets
} // namespace Surge
2 changes: 2 additions & 0 deletions src/surge-xt/gui/widgets/TypeAheadTextEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ struct TypeAhead : public juce::TextEditor, juce::TextEditor::Listener
void parentHierarchyChanged() override;
void textEditorTextChanged(juce::TextEditor &editor) override;

void focusLost(FocusChangeType type) override;

bool setToElementZeroOnReturn{false};
void textEditorReturnKeyPressed(juce::TextEditor &editor) override;
void textEditorEscapeKeyPressed(juce::TextEditor &editor) override;
Expand Down

0 comments on commit c239cad

Please sign in to comment.