1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-12 17:35:33 +01:00

Fix Mac tabbing to sliders and meters, analogously to buttons...

... And make sure they don't steal focus when clicked or double clicked
This commit is contained in:
Paul Licameli
2016-06-25 00:06:22 -04:00
parent d31e96aa57
commit 57788c8d7a
7 changed files with 71 additions and 10 deletions

View File

@@ -2083,6 +2083,23 @@ wxString Meter::Key(const wxString & key) const
return wxT("/Meter/Output/") + key;
}
bool Meter::s_AcceptsFocus{ false };
auto Meter::TemporarilyAllowFocus() -> TempAllowFocus {
s_AcceptsFocus = true;
return std::move(TempAllowFocus{ &s_AcceptsFocus });
}
// This compensates for a but in wxWidgets 3.0.2 for mac:
// Couldn't set focus from keyboard when AcceptsFocus returns false;
// this bypasses that limitation
void Meter::SetFocusFromKbd()
{
auto temp = TemporarilyAllowFocus();
SetFocus();
}
#if wxUSE_ACCESSIBILITY
MeterAx::MeterAx(wxWindow *window):