From fc84b19bba0e0953ec06de27f1ec9c9f8d1a96ef Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Tue, 26 Oct 2021 22:42:07 +0200 Subject: 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 --- lib/ui/fill.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/ui/fill.go b/lib/ui/fill.go index 0ab4f74..13ad286 100644 --- a/lib/ui/fill.go +++ b/lib/ui/fill.go @@ -4,16 +4,19 @@ import ( "github.com/gdamore/tcell/v2" ) -type Fill rune +type Fill struct { + Rune rune + Style tcell.Style +} -func NewFill(f rune) Fill { - return Fill(f) +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, rune(f), tcell.StyleDefault) + ctx.SetCell(x, y, f.Rune, f.Style) } } } -- cgit 1.4.1-2-gfad0