Skip to content

Commit

Permalink
Filter Analysis doesn't grab Kbd Focus on open
Browse files Browse the repository at this point in the history
This avoids a hover-paint on the filter 1 button when its neither
selected nor hovered. Since this is a non-accessible UI this
is basically what we want anyway.

Also make wantsInitialKeyboardFocus false.

Closes surge-synthesizer#7361
  • Loading branch information
baconpaul committed Jan 21, 2024
1 parent 3f70b6c commit 228e9d9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/surge-xt/gui/overlays/FilterAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ struct FilterAnalysis : public OverlayComponent, Surge::GUI::SkinConsumingCompon
int whichFilter{0};
void selectFilter(int which);

bool wantsInitialKeyboardFocus() const override { return false; }

std::unique_ptr<Surge::Widgets::SelfDrawToggleButton> f1Button, f2Button;
std::unique_ptr<FilterAnalysisEvaluator> evaluator;
bool shouldRepaintOnParamChange(const SurgePatch &patch, Parameter *p) override;
Expand Down
2 changes: 0 additions & 2 deletions src/surge-xt/gui/overlays/Oscilloscope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1243,8 +1243,6 @@ void Oscilloscope::visibilityChanged()
}
}

bool Oscilloscope::wantsInitialKeyboardFocus() { return false; }

// Lock for member variables must be held by the caller.
void Oscilloscope::calculateSpectrumData()
{
Expand Down
2 changes: 1 addition & 1 deletion src/surge-xt/gui/overlays/Oscilloscope.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class Oscilloscope : public OverlayComponent,
void resized() override;
void updateDrawing();
void visibilityChanged() override;
bool wantsInitialKeyboardFocus() override;
bool wantsInitialKeyboardFocus() const override { return false; }

void valueChanged(GUI::IComponentTagValue *p) override{};
int32_t controlModifierClicked(Surge::GUI::IComponentTagValue *pControl,
Expand Down
2 changes: 1 addition & 1 deletion src/surge-xt/gui/overlays/OverlayComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct OverlayComponent : juce::Component
virtual void forceDataRefresh() {}

// For A11Y: should the overlay be granted keyboard focus as soon as it appears.
virtual bool wantsInitialKeyboardFocus() { return true; }
virtual bool wantsInitialKeyboardFocus() const { return true; }

/*
* This is called when a parent wrapper finally decides to show me, which will
Expand Down

0 comments on commit 228e9d9

Please sign in to comment.