mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-07 15:49:42 +02:00
Bug1033: Swap-channels command will not lose the track focus
This commit is contained in:
parent
83d4f30706
commit
a7adbb54fc
@ -8856,6 +8856,10 @@ void TrackPanel::OnChannelChange(wxCommandEvent & event)
|
||||
void TrackPanel::OnSwapChannels(wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
Track *partner = mPopupMenuTarget->GetLink();
|
||||
Track *const focused = GetFocusedTrack();
|
||||
const bool hasFocus =
|
||||
(focused == mPopupMenuTarget || focused == partner);
|
||||
|
||||
SplitStereo(true);
|
||||
mPopupMenuTarget->SetChannel(Track::RightChannel);
|
||||
partner->SetChannel(Track::LeftChannel);
|
||||
@ -8868,6 +8872,9 @@ void TrackPanel::OnSwapChannels(wxCommandEvent & WXUNUSED(event))
|
||||
pMixerBoard->UpdateTrackClusters();
|
||||
}
|
||||
|
||||
if (hasFocus)
|
||||
SetFocusedTrack(partner);
|
||||
|
||||
MakeParentPushState(wxString::Format(_("Swapped Channels in '%s'"),
|
||||
mPopupMenuTarget->GetName().c_str()),
|
||||
_("Swap Channels"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user