1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-14 17:14:07 +01:00

Better cursors for sub-view rearrangement

This commit is contained in:
Paul Licameli
2020-01-15 21:55:24 -05:00
parent e14c9538ad
commit a95838a3e8
3 changed files with 46 additions and 2 deletions

View File

@@ -488,6 +488,8 @@ public:
return RefreshNone;
}
bool Clicked() const { return !mHeights.empty(); }
enum DragChoice_t{ Upward, Downward, Neutral };
DragChoice_t DragChoice( const TrackPanelMouseEvent &event ) const
@@ -561,10 +563,13 @@ public:
HitTestPreview Preview(
const TrackPanelMouseState &state, AudacityProject * ) override
{
static wxCursor cursor{ wxCURSOR_HAND };
static auto hoverCursor =
::MakeCursor(wxCURSOR_HAND, RearrangeCursorXpm, 16, 16);
static auto clickedCursor =
::MakeCursor(wxCURSOR_HAND, RearrangingCursorXpm, 16, 16);
return {
XO("Click and drag to rearrange sub-views"),
&cursor
Clicked() ? &*clickedCursor : &*hoverCursor
};
}