aerc/lib/ui/fill.go

31 lines
446 B
Go
Raw Normal View History

2018-02-28 02:17:26 +00:00
package ui
import (
"github.com/gdamore/tcell/v2"
2018-02-28 02:17:26 +00:00
)
type Fill struct {
Rune rune
Style tcell.Style
}
2018-02-28 02:17:26 +00:00
func NewFill(f rune, s tcell.Style) Fill {
return Fill{f, s}
2018-02-28 02:17:26 +00:00
}
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, f.Rune, f.Style)
2018-02-28 02:17:26 +00:00
}
}
}
func (f Fill) OnInvalidate(callback func(d Drawable)) {
// no-op
}
func (f Fill) Invalidate() {
// no-op
}