From f776fb82469d0b9aefffd3f16b27024d53d922c8 Mon Sep 17 00:00:00 2001 From: Dian M Fay Date: Mon, 29 Nov 2021 17:48:35 -0500 Subject: 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 --- lib/ui/borders.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/ui') 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) -- cgit