summary refs log tree commit diff stats
path: root/lib/ui/borders.go
diff options
context:
space:
mode:
authorMarkus Ongyerth <aerc@ongy.net>2018-06-01 09:58:00 +0200
committerDrew DeVault <sir@cmpwn.com>2018-06-01 16:04:43 -0700
commit80e891a8024ac10a60daa790131e04f0326b0c73 (patch)
tree7a07cc26b2885e43e57e1672d2895c7fae2b173e /lib/ui/borders.go
parent3836d240c9aa26615e7d768a57436d171edc3831 (diff)
downloadaerc-80e891a8024ac10a60daa790131e04f0326b0c73.tar.gz
switch to tcell from termbox
This is a simple mostly straight forward switch to tcell in favor of
termbox.
It uses the tcell native api (not the compat layer) but does not make
use of most features.

Further changes should include moving to tcell's views.TextArea and the
general built in widget behaviour instead of the current ad hoc
implementation.

Regression: Cursor isn't shown in ex-line
Diffstat (limited to 'lib/ui/borders.go')
-rw-r--r--lib/ui/borders.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/ui/borders.go b/lib/ui/borders.go
index 08071ad..38b35fd 100644
--- a/lib/ui/borders.go
+++ b/lib/ui/borders.go
@@ -1,7 +1,7 @@
 package ui
 
 import (
-	tb "github.com/nsf/termbox-go"
+	"github.com/gdamore/tcell"
 )
 
 const (
@@ -45,27 +45,23 @@ func (bordered *Bordered) Draw(ctx *Context) {
 	y := 0
 	width := ctx.Width()
 	height := ctx.Height()
-	cell := tb.Cell{
-		Ch: ' ',
-		Fg: tb.ColorBlack,
-		Bg: tb.ColorWhite,
-	}
+	style := tcell.StyleDefault.Background(tcell.ColorWhite).Foreground(tcell.ColorBlack)
 	if bordered.borders&BORDER_LEFT != 0 {
-		ctx.Fill(0, 0, 1, ctx.Height(), cell)
+		ctx.Fill(0, 0, 1, ctx.Height(), ' ', style)
 		x += 1
 		width -= 1
 	}
 	if bordered.borders&BORDER_TOP != 0 {
-		ctx.Fill(0, 0, ctx.Width(), 1, cell)
+		ctx.Fill(0, 0, ctx.Width(), 1, ' ', style)
 		y += 1
 		height -= 1
 	}
 	if bordered.borders&BORDER_RIGHT != 0 {
-		ctx.Fill(ctx.Width()-1, 0, 1, ctx.Height(), cell)
+		ctx.Fill(ctx.Width()-1, 0, 1, ctx.Height(), ' ', style)
 		width -= 1
 	}
 	if bordered.borders&BORDER_BOTTOM != 0 {
-		ctx.Fill(0, ctx.Height()-1, ctx.Width(), 1, cell)
+		ctx.Fill(0, ctx.Height()-1, ctx.Width(), 1, ' ', style)
 		height -= 1
 	}
 	subctx := ctx.Subcontext(x, y, width, height)