CellularPanel handles save/restore of focus for clicks in ruler...

... This lets the ESC key really work to abort drags
This commit is contained in:
Paul Licameli 2018-08-02 11:51:56 -04:00
parent c85d2cdfa0
commit 9491605cfc
2 changed files with 0 additions and 25 deletions

View File

@ -3595,19 +3595,6 @@ void AdornedRulerPanel::GetMaxSize(wxCoord *width, wxCoord *height)
mRuler.GetMaxSize(width, height);
}
bool AdornedRulerPanel::s_AcceptsFocus{ false };
auto AdornedRulerPanel::TemporarilyAllowFocus() -> TempAllowFocus {
s_AcceptsFocus = true;
return TempAllowFocus{ &s_AcceptsFocus };
}
void AdornedRulerPanel::SetFocusFromKbd()
{
auto temp = TemporarilyAllowFocus();
SetFocus();
}
// CellularPanel implementation
auto AdornedRulerPanel::FindCell(int mouseX, int mouseY) -> FoundCell
{

View File

@ -322,10 +322,6 @@ public:
~AdornedRulerPanel();
bool AcceptsFocus() const override { return s_AcceptsFocus; }
bool AcceptsFocusFromKeyboard() const override { return true; }
void SetFocusFromKbd() override;
public:
int GetRulerHeight() { return GetRulerHeight(mShowScrubbing); }
static int GetRulerHeight(bool showScrubBar);
@ -385,14 +381,6 @@ public:
void DoDrawIndicator(wxDC * dc, wxCoord xx, bool playing, int width, bool scrub, bool seek);
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:
void DoDrawPlayRegion(wxDC * dc);