aerc/lib/ui/fill.go
Markus Ongyerth 80e891a802 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
2018-06-01 16:04:43 -07:00

28 lines
400 B
Go

package ui
import (
"github.com/gdamore/tcell"
)
type Fill rune
func NewFill(f rune) Fill {
return Fill(f)
}
func (f Fill) Draw(ctx *Context) {
for x := 0; x < ctx.Width(); x += 1 {
for y := 0; y < ctx.Height(); y += 1 {
ctx.SetCell(x, y, rune(f), tcell.StyleDefault)
}
}
}
func (f Fill) OnInvalidate(callback func(d Drawable)) {
// no-op
}
func (f Fill) Invalidate() {
// no-op
}