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

Bug 1484 - (Residual) Alternative Ctrl-Click behaviour on Wave

Previously Ctrl Click on Wave behaved exactly as Ctrl Click on Track Control Panel.  With this change on wave it
(a) No longer toggles.  It only adds.
(b) It will extend and can be drag extended.

It is possible to change (a) to be toggle if that is desired.
This should ease the creation and extension of discontinuous track selections.
This commit is contained in:
James Crook 2016-08-31 23:38:54 +01:00
parent 09e6d20dbc
commit 6881163129

View File

@ -1961,14 +1961,24 @@ void TrackPanel::SelectionHandleClick(wxMouseEvent & event,
bool stretch = HitTestStretch(pTrack, rect, event);
#endif
if (event.ShiftDown()
bool bShiftDown = event.ShiftDown();
bool bCtrlDown = event.ControlDown();
if (bShiftDown || bCtrlDown
#ifdef USE_MIDI
&& !stretch
#endif
) {
ChangeSelectionOnShiftClick( pTrack );
if( bShiftDown )
ChangeSelectionOnShiftClick( pTrack );
if( bCtrlDown ){
//bool bIsSelected = pTrack->GetSelected();
bool bIsSelected = false;
// could set bIsSelected true here, but toggling is more technically correct.
// if we want to match behaviour in Track Control Panel.
SelectTrack( pTrack, !bIsSelected, false );
}
double value;
// Shift-click, choose closest boundary
@ -2757,7 +2767,8 @@ void TrackPanel::SelectionHandleDrag(wxMouseEvent & event, Track *clickedTrack)
if (event.CmdDown()) {
// Ctrl-drag has no meaning, fuhggeddaboudit
return;
// JKC YES it has meaning.
//return;
}
wxRect rect = mCapturedRect;
@ -6242,7 +6253,7 @@ bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &rect,
bool bShift = event.ShiftDown();
bool bCtrlDown = event.ControlDown();
bool unsafe = IsUnsafe();
bCtrlDown = false;
if( /*bShift ||*/ bCtrlDown ){
HandleListSelection(track, bShift, bCtrlDown, !unsafe);