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:
parent
c85d2cdfa0
commit
9491605cfc
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue