diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2024-02-12 06:26:23 -0600 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-02-12 13:48:56 +0100 |
commit | 58f94fa0a1333dfccfb24f90b22506b29a64397b (patch) | |
tree | b2b9d4e89560f3c022807f6e1e66cc83f2c58de9 /app/dirlist.go | |
parent | 4d14efc470926b3e0ab61efa6b7cdabae3cf1763 (diff) | |
download | aerc-58f94fa0a1333dfccfb24f90b22506b29a64397b.tar.gz |
mouse: use vaxis mouse events
Replace all tcell.EventMouse events with vaxis mouse events
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'app/dirlist.go')
-rw-r--r-- | app/dirlist.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/app/dirlist.go b/app/dirlist.go index e9228374..71db2b6a 100644 --- a/app/dirlist.go +++ b/app/dirlist.go @@ -8,8 +8,6 @@ import ( "sort" "time" - "github.com/gdamore/tcell/v2" - "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" "git.sr.ht/~rjarry/aerc/lib/parse" @@ -376,16 +374,16 @@ func (dirlist *DirectoryList) drawScrollbar(ctx *ui.Context) { } func (dirlist *DirectoryList) MouseEvent(localX int, localY int, event vaxis.Event) { - if event, ok := event.(*tcell.EventMouse); ok { - switch event.Buttons() { - case tcell.Button1: + if event, ok := event.(vaxis.Mouse); ok { + switch event.Button { + case vaxis.MouseLeftButton: clickedDir, ok := dirlist.Clicked(localX, localY) if ok { dirlist.Select(clickedDir) } - case tcell.WheelDown: + case vaxis.MouseWheelDown: dirlist.Next() - case tcell.WheelUp: + case vaxis.MouseWheelUp: dirlist.Prev() } } |