1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-06 23:02:42 +02:00

Make tabbing between toolbar buttons work on Mac

This commit is contained in:
Paul Licameli 2016-06-24 23:23:20 -04:00
parent fe509ed412
commit d31e96aa57
2 changed files with 11 additions and 0 deletions

View File

@ -242,6 +242,15 @@ void AButton::UseDisabledAsDownHiliteImage(bool flag)
mUseDisabledAsDownHiliteImage = flag;
}
// 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 AButton::SetFocusFromKbd()
{
auto temp = AButton::TemporarilyAllowFocus();
SetFocus();
}
void AButton::SetAlternateImages(unsigned idx,
wxImage up,
wxImage over,

View File

@ -59,6 +59,8 @@ class AButton final : public wxWindow {
bool AcceptsFocus() const override { return s_AcceptsFocus; }
bool AcceptsFocusFromKeyboard() const override { return true; }
void SetFocusFromKbd() override;
// Associate a set of four images (button up, highlight, button down,
// disabled) with one nondefault state of the button
void SetAlternateImages(unsigned idx,