aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2024-02-12 06:26:12 -0600
committerRobin Jarry <robin@jarry.cc>2024-02-12 13:46:27 +0100
commit6eff242090dc75d2cc466b023bcbebd78d3d47cb (patch)
treefa8723276f2fac816b2137ae5e87706908fe34f8 /lib/ui
parenta11e0bf692b7f17af07252748f105a8277a07196 (diff)
downloadaerc-6eff242090dc75d2cc466b023bcbebd78d3d47cb.tar.gz
ui: so long tcell
Replace tcell with vaxis. Vaxis provides several new features (none of which are included in this commit). All behavior should be exactly the same as previous, with one exception: Vaxis does not have an internal terminfo library. Some terminals will now have RGB that didn't before, as well as any other feature that was falling back to some unknown state. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/ui')
-rw-r--r--lib/ui/ui.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/ui/ui.go b/lib/ui/ui.go
index 6a28eb9c..b5c66530 100644
--- a/lib/ui/ui.go
+++ b/lib/ui/ui.go
@@ -6,6 +6,8 @@ import (
"sync/atomic"
"syscall"
+ "git.sr.ht/~rjarry/aerc/config"
+ "git.sr.ht/~rockorager/vaxis"
"github.com/gdamore/tcell/v2"
)
@@ -51,7 +53,10 @@ func Initialize(content DrawableInteractive) error {
return err
}
- if err = screen.Init(); err != nil {
+ opts := vaxis.Options{
+ DisableMouse: !config.Ui.MouseEnabled,
+ }
+ if err = screen.Init(opts); err != nil {
return err
}
@@ -140,6 +145,11 @@ func HandleEvent(event tcell.Event) {
state.ctx = NewContext(width, height, state.screen, onPopover)
Invalidate()
}
+ if event, ok := event.(tcell.VaxisEvent); ok {
+ if _, ok := event.Vaxis().(vaxis.Redraw); ok {
+ Invalidate()
+ }
+ }
// if we have a popover, and it can handle the event, it does so
if state.popover == nil || !state.popover.Event(event) {
// otherwise, we send the event to the main content