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/partswitcher.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/partswitcher.go')
-rw-r--r-- | app/partswitcher.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/partswitcher.go b/app/partswitcher.go index 5dc996f7..5a935a8c 100644 --- a/app/partswitcher.go +++ b/app/partswitcher.go @@ -6,7 +6,6 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib/ui" "git.sr.ht/~rockorager/vaxis" - "github.com/gdamore/tcell/v2" "github.com/mattn/go-runewidth" ) @@ -168,7 +167,7 @@ func (ps *PartSwitcher) MouseEvent(localX int, localY int, event vaxis.Event) { return } - e, ok := event.(*tcell.EventMouse) + e, ok := event.(vaxis.Mouse) if !ok { return } @@ -177,8 +176,8 @@ func (ps *PartSwitcher) MouseEvent(localX int, localY int, event vaxis.Event) { ps.parts[ps.selected].term.Focus(false) } - switch e.Buttons() { - case tcell.Button1: + switch e.Button { + case vaxis.MouseLeftButton: i := localY - ps.offset + ps.Scroll() if i < 0 || i >= len(ps.parts) { break @@ -188,10 +187,10 @@ func (ps *PartSwitcher) MouseEvent(localX int, localY int, event vaxis.Event) { } ps.selected = i ps.Invalidate() - case tcell.WheelDown: + case vaxis.MouseWheelDown: ps.NextPart() ps.Invalidate() - case tcell.WheelUp: + case vaxis.MouseWheelUp: ps.PreviousPart() ps.Invalidate() } |