aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui/ui.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui/ui.go')
-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