aboutsummaryrefslogtreecommitdiffstats
path: root/app/dirtree.go
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2024-02-12 06:26:23 -0600
committerRobin Jarry <robin@jarry.cc>2024-02-12 13:48:56 +0100
commit58f94fa0a1333dfccfb24f90b22506b29a64397b (patch)
treeb2b9d4e89560f3c022807f6e1e66cc83f2c58de9 /app/dirtree.go
parent4d14efc470926b3e0ab61efa6b7cdabae3cf1763 (diff)
downloadaerc-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/dirtree.go')
-rw-r--r--app/dirtree.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/app/dirtree.go b/app/dirtree.go
index 30ef2480..995c8889 100644
--- a/app/dirtree.go
+++ b/app/dirtree.go
@@ -15,7 +15,6 @@ import (
"git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/worker/types"
"git.sr.ht/~rockorager/vaxis"
- "github.com/gdamore/tcell/v2"
)
type DirectoryTree struct {
@@ -168,16 +167,16 @@ func (dt *DirectoryTree) Draw(ctx *ui.Context) {
}
func (dt *DirectoryTree) 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 := dt.Clicked(localX, localY)
if ok {
dt.Select(clickedDir)
}
- case tcell.WheelDown:
+ case vaxis.MouseWheelDown:
dt.NextPrev(1)
- case tcell.WheelUp:
+ case vaxis.MouseWheelUp:
dt.NextPrev(-1)
}
}