mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-06 23:02:42 +02:00
Once again permit TAB navigation to pinned head button on Mac...
... But still don't let the ruler accept focus from a click on any platform
This commit is contained in:
parent
0f597ae98e
commit
4375010983
@ -3284,3 +3284,16 @@ void AdornedRulerPanel::GetMaxSize(wxCoord *width, wxCoord *height)
|
|||||||
{
|
{
|
||||||
mRuler.GetMaxSize(width, height);
|
mRuler.GetMaxSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AdornedRulerPanel::s_AcceptsFocus{ false };
|
||||||
|
|
||||||
|
auto AdornedRulerPanel::TemporarilyAllowFocus() -> TempAllowFocus {
|
||||||
|
s_AcceptsFocus = true;
|
||||||
|
return std::move(TempAllowFocus{ &s_AcceptsFocus });
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdornedRulerPanel::SetFocusFromKbd()
|
||||||
|
{
|
||||||
|
auto temp = TemporarilyAllowFocus();
|
||||||
|
SetFocus();
|
||||||
|
}
|
||||||
|
@ -294,8 +294,9 @@ public:
|
|||||||
|
|
||||||
~AdornedRulerPanel();
|
~AdornedRulerPanel();
|
||||||
|
|
||||||
bool AcceptsFocus() const override { return false; }
|
bool AcceptsFocus() const override { return s_AcceptsFocus; }
|
||||||
bool AcceptsFocusFromKeyboard() const override { return false; }
|
bool AcceptsFocusFromKeyboard() const override { return true; }
|
||||||
|
void SetFocusFromKbd() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int GetRulerHeight() { return GetRulerHeight(mShowScrubbing); }
|
int GetRulerHeight() { return GetRulerHeight(mShowScrubbing); }
|
||||||
@ -357,6 +358,14 @@ public:
|
|||||||
void DoDrawIndicator(wxDC * dc, wxCoord xx, bool playing, int width, bool scrub, bool seek);
|
void DoDrawIndicator(wxDC * dc, wxCoord xx, bool playing, int width, bool scrub, bool seek);
|
||||||
void UpdateButtonStates();
|
void UpdateButtonStates();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static bool s_AcceptsFocus;
|
||||||
|
struct Resetter { void operator () (bool *p) const { if(p) *p = false; } };
|
||||||
|
using TempAllowFocus = std::unique_ptr<bool, Resetter>;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static TempAllowFocus TemporarilyAllowFocus();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QuickPlayIndicatorOverlay *GetOverlay();
|
QuickPlayIndicatorOverlay *GetOverlay();
|
||||||
void ShowOrHideQuickPlayIndicator(bool show);
|
void ShowOrHideQuickPlayIndicator(bool show);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user