diff options
author | Robin Jarry <robin@jarry.cc> | 2021-10-26 22:42:07 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2021-10-28 16:38:23 +0200 |
commit | fc84b19bba0e0953ec06de27f1ec9c9f8d1a96ef (patch) | |
tree | 04379398cf135658019ddcfbdc0fddcba305b3de /lib | |
parent | 42b4302ba32e503c0a8011baae0ca433c8592dd7 (diff) | |
download | aerc-fc84b19bba0e0953ec06de27f1ec9c9f8d1a96ef.tar.gz |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ui/fill.go | 11 |
1 files changed, 7 insertions, 4 deletions
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) } } } |