aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui/textinput.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 /lib/ui/textinput.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 'lib/ui/textinput.go')
-rw-r--r--lib/ui/textinput.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go
index d52ee07a..a01184f2 100644
--- a/lib/ui/textinput.go
+++ b/lib/ui/textinput.go
@@ -6,7 +6,6 @@ import (
"sync"
"time"
- "github.com/gdamore/tcell/v2"
"github.com/mattn/go-runewidth"
"git.sr.ht/~rjarry/aerc/config"
@@ -144,9 +143,9 @@ func (ti *TextInput) drawPopover(ctx *Context) {
ctx.Popover(pos, 0, width, height, cmp)
}
-func (ti *TextInput) MouseEvent(localX int, localY int, event tcell.Event) {
- if event, ok := event.(*tcell.EventMouse); ok {
- if event.Buttons() == tcell.Button1 {
+func (ti *TextInput) MouseEvent(localX int, localY int, event vaxis.Event) {
+ if event, ok := event.(vaxis.Mouse); ok {
+ if event.Button == vaxis.MouseLeftButton {
if localX >= len(ti.prompt)+1 && localX <= len(ti.text[ti.scroll:])+len(ti.prompt)+1 {
ti.index = localX - len(ti.prompt) - 1
ti.ensureScroll()