diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2024-02-12 06:26:16 -0600 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-02-12 13:48:44 +0100 |
commit | 787cfbd9a90a26072a8dd61a28eca11dd6e20c04 (patch) | |
tree | b64f887898c810e3de9a9b4dd9c2bc0317cf7902 /app | |
parent | 63b9706441719b53b3504733c51c2387fce9019d (diff) | |
download | aerc-787cfbd9a90a26072a8dd61a28eca11dd6e20c04.tar.gz |
ui: remove screen and viewports
Remove references to tcell.Screen or views.Viewports. Convert Contexts
and the core UI struct to use Vaxis objects only.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'app')
-rw-r--r-- | app/terminal.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/app/terminal.go b/app/terminal.go index c99af26a..33478206 100644 --- a/app/terminal.go +++ b/app/terminal.go @@ -83,11 +83,11 @@ func (term *Terminal) Invalidate() { } func (term *Terminal) Draw(ctx *ui.Context) { - term.vterm.SetSurface(ctx.View()) + term.vterm.SetSurface(ctx) - w, h := ctx.View().Size() + w, h := ctx.Size() if !term.isClosed() && term.ctx != nil { - ow, oh := term.ctx.View().Size() + ow, oh := term.ctx.Size() if w != ow || h != oh { term.vterm.Resize(w, h) } @@ -109,8 +109,7 @@ func (term *Terminal) Draw(ctx *ui.Context) { if term.focus { y, x, style, vis := term.vterm.Cursor() if vis && !term.isClosed() { - ctx.SetCursor(x, y) - ctx.SetCursorStyle(style) + ctx.SetCursor(x, y, vaxis.CursorStyle(style)) } else { ctx.HideCursor() } @@ -150,8 +149,7 @@ func (term *Terminal) Focus(focus bool) { term.ctx.HideCursor() } else { y, x, style, _ := term.vterm.Cursor() - term.ctx.SetCursor(x, y) - term.ctx.SetCursorStyle(style) + term.ctx.SetCursor(x, y, vaxis.CursorStyle(style)) term.Invalidate() } } |