1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-01 20:14:49 +02:00

TrackPanel listens for Undo events, doesn't intrude in ProjectHistory

This commit is contained in:
Paul Licameli
2019-06-08 12:18:04 -04:00
parent d1a1b112ba
commit d85b297ca5
3 changed files with 13 additions and 5 deletions

View File

@@ -78,6 +78,8 @@ is time to refresh some aspect of the screen.
#include "TrackPanelResizeHandle.h"
//#define DEBUG_DRAW_TIMING 1
#include "UndoManager.h"
#include "AColor.h"
#include "AllThemeResources.h"
#include "AudioIO.h"
@@ -320,6 +322,8 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id,
theProject->Bind(
EVT_PROJECT_SETTINGS_CHANGE, &TrackPanel::OnProjectSettingsChange, this);
theProject->Bind(EVT_UNDO_RESET, &TrackPanel::OnUndoReset, this);
UpdatePrefs();
}
@@ -554,6 +558,13 @@ double TrackPanel::GetScreenEndTime() const
return mViewInfo->PositionToTime(width, 0, true);
}
void TrackPanel::OnUndoReset( wxCommandEvent &event )
{
event.Skip();
SetFocusedTrack( nullptr );
Refresh( false );
}
/// AS: OnPaint( ) is called during the normal course of
/// completing a repaint operation.
void TrackPanel::OnPaint(wxPaintEvent & /* event */)