aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui/borders.go
diff options
context:
space:
mode:
authorKalyan Sriram <coder.kalyan@gmail.com>2020-07-27 01:03:55 -0700
committerReto Brunner <reto@labrat.space>2020-07-30 19:35:59 +0200
commit1ff687ca2b0821c2cacc1fa725abb3302d2af9da (patch)
treeb84df04a645c1fd2ee94d7a08f2f9c717930e9ab /lib/ui/borders.go
parent1bab1754f095a5c0537fc639d0214f6efbb340a2 (diff)
downloadaerc-1ff687ca2b0821c2cacc1fa725abb3302d2af9da.tar.gz
Implement style configuration.
Introduce the ability to configure stylesets, allowing customization of aerc's look (color scheme, font weight, etc). Default styleset is installed to /path/to/aerc/stylesets/default.
Diffstat (limited to 'lib/ui/borders.go')
-rw-r--r--lib/ui/borders.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/ui/borders.go b/lib/ui/borders.go
index 7a757595..99d6880d 100644
--- a/lib/ui/borders.go
+++ b/lib/ui/borders.go
@@ -2,6 +2,8 @@ package ui
import (
"github.com/gdamore/tcell"
+
+ "git.sr.ht/~sircmpwn/aerc/config"
)
const (
@@ -16,12 +18,15 @@ type Bordered struct {
borders uint
content Drawable
onInvalidate func(d Drawable)
+ uiConfig config.UIConfig
}
-func NewBordered(content Drawable, borders uint) *Bordered {
+func NewBordered(
+ content Drawable, borders uint, uiConfig config.UIConfig) *Bordered {
b := &Bordered{
- borders: borders,
- content: content,
+ borders: borders,
+ content: content,
+ uiConfig: uiConfig,
}
content.OnInvalidate(b.contentInvalidated)
return b
@@ -44,7 +49,7 @@ func (bordered *Bordered) Draw(ctx *Context) {
y := 0
width := ctx.Width()
height := ctx.Height()
- style := tcell.StyleDefault.Reverse(true)
+ style := bordered.uiConfig.GetStyle(config.STYLE_BORDER)
if bordered.borders&BORDER_LEFT != 0 {
ctx.Fill(0, 0, 1, ctx.Height(), ' ', style)
x += 1