aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui
diff options
context:
space:
mode:
authorDian M Fay <dian.m.fay@gmail.com>2021-11-29 17:48:35 -0500
committerRobin Jarry <robin@jarry.cc>2021-11-30 15:05:33 +0100
commitf776fb82469d0b9aefffd3f16b27024d53d922c8 (patch)
tree7f683ad0ae2f5e8c19d5fbef1a2e23a98d7279c5 /lib/ui
parentad5f65b92788d624a036af763a8243c19fc4c1a8 (diff)
downloadaerc-f776fb82469d0b9aefffd3f16b27024d53d922c8.tar.gz
style: customize vertical and horizontal border characters
New border-char-horizontal and border-char-vertical config settings in aerc.conf allow users to modify border appearance from the default 1-wide/tall blank space. In stylesets, border.fg now affects the foreground color when custom characters are defined. Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/ui')
-rw-r--r--lib/ui/borders.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/ui/borders.go b/lib/ui/borders.go
index 1b69a8e7..886a171b 100644
--- a/lib/ui/borders.go
+++ b/lib/ui/borders.go
@@ -50,22 +50,25 @@ func (bordered *Bordered) Draw(ctx *Context) {
width := ctx.Width()
height := ctx.Height()
style := bordered.uiConfig.GetStyle(config.STYLE_BORDER)
+ verticalChar := bordered.uiConfig.BorderCharVertical
+ horizontalChar := bordered.uiConfig.BorderCharHorizontal
+
if bordered.borders&BORDER_LEFT != 0 {
- ctx.Fill(0, 0, 1, ctx.Height(), ' ', style)
+ ctx.Fill(0, 0, 1, ctx.Height(), verticalChar, style)
x += 1
width -= 1
}
if bordered.borders&BORDER_TOP != 0 {
- ctx.Fill(0, 0, ctx.Width(), 1, ' ', style)
+ ctx.Fill(0, 0, ctx.Width(), 1, horizontalChar, style)
y += 1
height -= 1
}
if bordered.borders&BORDER_RIGHT != 0 {
- ctx.Fill(ctx.Width()-1, 0, 1, ctx.Height(), ' ', style)
+ ctx.Fill(ctx.Width()-1, 0, 1, ctx.Height(), verticalChar, style)
width -= 1
}
if bordered.borders&BORDER_BOTTOM != 0 {
- ctx.Fill(0, ctx.Height()-1, ctx.Width(), 1, ' ', style)
+ ctx.Fill(0, ctx.Height()-1, ctx.Width(), 1, horizontalChar, style)
height -= 1
}
subctx := ctx.Subcontext(x, y, width, height)