aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui/borders.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-05-27 07:37:02 +0200
committerReto Brunner <reto@labrat.space>2020-05-27 07:57:10 +0200
commit0f78f06610c0e8887aba2ae50e99b86477a384b3 (patch)
treeff4cd6581d3af0911954a37550602366d2bb0e2f /lib/ui/borders.go
parent6c4ed3cfe2fe66a1e5f26c404ea90e048142db72 (diff)
downloadaerc-0f78f06610c0e8887aba2ae50e99b86477a384b3.tar.gz
Add Style configuration
The following functionalities are added to configure aerc ui styles. - Read stylesets from file with very basic fnmatch wildcard matching - Add default styleset - Support different stylesets as part of UiConfig allowing contextual styles. - Move widgets/ui elements to use the stylesets. - Add configuration manual for the styleset
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