mirror of
https://git.sr.ht/~sircmpwn/aerc
synced 2024-11-23 16:42:07 +01:00
80e891a802
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
28 lines
400 B
Go
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
|
|
}
|