1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-30 23:49:28 +02: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

@ -16,6 +16,7 @@
#include "Cursors32/DisabledCursor.xpm"
#include "Cursors32/RearrangeCursor.xpm"
#include "Cursors32/RearrangingCursor.xpm"
#include "Cursors32/EnvCursor.xpm"
#include "Cursors32/TimeCursor.xpm"
#include "Cursors32/IBeamCursor.xpm"

View File

@ -0,0 +1,38 @@
/* XPM */
static const char * const RearrangingCursorXpm[] = {
"32 32 3 1",
" c #FF0000", // mask color = RGB:255,0,0
". c #000000",
"+ c #FFFFFF",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" .. .. .. ",
" .++.++.++.. ",
" .++++++++++. ",
" ..++++++++++. ",
" .+.+++++++++++. ",
" .+.+++++++++++. ",
" .+++++++++++++. ",
" .+++++++++++++. ",
" .+++++++++++++. ",
" .+++++++++++++. ",
" .+++++++++++. ",
" .++++++++++. ",
" .++++++++. ",
" ..++++.. ",
" .... ",
" ",
" ",
" ",
" ",
" ",
" "};

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
};
}