aerc/lib/ui/fill.go
Robin Jarry fc84b19bba view,compose: use border color to separate headers from body
When composing a message, there is an empty fill line between the
headers and the text editor. The line is printed with the default style
which may cause users to assume it is part of the editor.

Display the fill lines with the border color to avoid confusion.

Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-10-28 16:38:23 +02:00

31 lines
446 B
Go

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