1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-28 14:18:41 +02:00

Show drag cursor to rearrange tracks only when there is more than one

This commit is contained in:
Paul Licameli 2020-02-20 13:40:40 -05:00
parent e4d5eefee0
commit adb46093fa

View File

@ -149,7 +149,7 @@ HitTestPreview TrackSelectHandle::Preview
//static wxCursor rearrangeCursor{ wxCURSOR_HAND };
static auto rearrangingCursor =
::MakeCursor(wxCURSOR_HAND, RearrangingCursorXpm, 16, 16);
static wxCursor arrowCursor{ wxCURSOR_ARROW };
//static auto hoverCursor =
// ::MakeCursor(wxCURSOR_HAND, RearrangeCursorXpm, 16, 16);
@ -161,18 +161,20 @@ HitTestPreview TrackSelectHandle::Preview
if (mClicked) {
const bool unsafe =
ProjectAudioIO::Get( *project ).IsAudioActive();
const bool canMove = TrackList::Get( *project ).Leaders().size() > 1;
return {
message,
(unsafe
? &*disabledCursor
: &*rearrangingCursor)
: canMove
? &*rearrangingCursor
: &arrowCursor)
// , message // Stop showing the tooltip after the click
};
}
else {
// Only mouse-over
// Don't test safety, because the click to change selection is allowed
static wxCursor arrowCursor{ wxCURSOR_ARROW };
return {
message,
&arrowCursor,