1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 16:09:28 +02:00

Bug2526: Switching projects should not disable label editing

This commit is contained in:
Paul Licameli 2020-09-04 11:26:22 -04:00
parent 8799d26335
commit d66ffaa4ce

View File

@ -260,6 +260,19 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id,
#pragma warning( default: 4355 )
#endif
{
// Whenever activation swaps between projects, the track panel "captures"
// the keyboard, which means its sub-cells like Label tracks are given
// the chance to process keystrokes before CommandManager.
std::once_flag flag;
std::call_once(flag, []{
wxTheApp->Bind(EVT_PROJECT_ACTIVATION,
[](wxCommandEvent &){
auto pProject = GetActiveProject();
if ( pProject )
KeyboardCapture::Capture( &TrackPanel::Get( *pProject ) );
});
});
SetLayoutDirection(wxLayout_LeftToRight);
SetLabel(XO("Track Panel"));
SetName(XO("Track Panel"));