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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user