1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-07 04:01:54 +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:
Paul Licameli
2019-06-12 11:04:38 -04:00
parent 702199f9d9
commit b7386c2db1
11 changed files with 11 additions and 53 deletions

View File

@@ -880,13 +880,6 @@ void ProjectWindow::RedrawProject(const bool bForceWaveTracks /*= false*/)
trackPanel.Refresh(false);
}
void ProjectWindow::RefreshCursor()
{
auto &project = mProject;
auto &trackPanel = TrackPanel::Get( project );
trackPanel.HandleCursorForPresentMouseState();
}
void ProjectWindow::OnThemeChange(wxCommandEvent& evt)
{
evt.Skip();
@@ -1289,12 +1282,6 @@ void ProjectWindow::FixScrollbars()
if (oldhstate != newhstate || oldvstate != newvstate) {
UpdateLayout();
}
wxWeakRef< TrackPanel > pPanel = &TrackPanel::Get( project );
CallAfter( [pPanel]{
if ( pPanel )
pPanel->HandleCursorForPresentMouseState();
} );
}
void ProjectWindow::UpdateLayout()
@@ -1491,12 +1478,6 @@ void ProjectWindow::DoScroll()
if (!mAutoScrolling) {
trackPanel.Refresh(false);
}
wxWeakRef< TrackPanel > pPanel = &TrackPanel::Get( project );
CallAfter( [pPanel]{
if ( pPanel )
pPanel->HandleCursorForPresentMouseState();
} );
}
void ProjectWindow::OnMenu(wxCommandEvent & event)