Implement the "Auto-focus audio display on mouse over" option

Originally committed to SVN as r6293.
This commit is contained in:
Thomas Goyne 2012-01-13 21:17:51 +00:00
parent 9166eb1d6b
commit d8cedf0eec

View file

@ -595,6 +595,7 @@ AudioDisplay::AudioDisplay(wxWindow *parent, AudioController *controller, agi::C
Bind(wxEVT_MIDDLE_UP, &AudioDisplay::OnMouseEvent, this);
Bind(wxEVT_RIGHT_UP, &AudioDisplay::OnMouseEvent, this);
Bind(wxEVT_MOTION, &AudioDisplay::OnMouseEvent, this);
Bind(wxEVT_ENTER_WINDOW, &AudioDisplay::OnMouseEvent, this);
}
@ -1062,7 +1063,7 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event)
return;
}
if (event.IsButton())
if (event.IsButton() || (event.Entering() && OPT_GET("Audio/Auto/Focus")->GetBool()))
SetFocus();
// Handle any ongoing drag