mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-15 23:44:59 +01:00
Use idle events to update TrackPanel cursor...
... As when recording starts or stops, or the Tools button has changed, or scrolling has changed the results of hit-test. This reduces TrackPanel's intrusions into other code, including ProjectHistory. Also for AdornedRulerPanel, which shares the base class CellularPanel
This commit is contained in:
@@ -313,9 +313,6 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id,
|
||||
mTracks->Bind(EVT_TRACKLIST_DELETION,
|
||||
&TrackPanel::OnTrackListDeletion,
|
||||
this);
|
||||
wxTheApp->Bind(EVT_AUDIOIO_PLAYBACK,
|
||||
&TrackPanel::OnPlayback,
|
||||
this);
|
||||
|
||||
auto theProject = GetProject();
|
||||
theProject->Bind(EVT_ODTASK_UPDATE, &TrackPanel::OnODTask, this);
|
||||
@@ -429,6 +426,7 @@ AudacityProject * TrackPanel::GetProject() const
|
||||
|
||||
void TrackPanel::OnIdle(wxIdleEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
// The window must be ready when the timer fires (#1401)
|
||||
if (IsShownOnScreen())
|
||||
{
|
||||
@@ -792,15 +790,6 @@ void TrackPanel::UpdateViewIfNoTracks()
|
||||
}
|
||||
}
|
||||
|
||||
void TrackPanel::OnPlayback(wxEvent &e)
|
||||
{
|
||||
e.Skip();
|
||||
// Starting or stopping of play or record affects some cursors.
|
||||
// Start or stop is in progress now, not completed; so delay the cursor
|
||||
// change until next idle time.
|
||||
CallAfter( [this] { HandleCursorForPresentMouseState(); } );
|
||||
}
|
||||
|
||||
// The tracks positions within the list have changed, so update the vertical
|
||||
// ruler size for the track that triggered the event.
|
||||
void TrackPanel::OnTrackListResizing(TrackListEvent & e)
|
||||
|
||||
Reference in New Issue
Block a user