summaryrefslogtreecommitdiff
path: root/lib/ui/tab.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/tab.go
parent1bab1754f095a5c0537fc639d0214f6efbb340a2 (diff)
downloadaerc-1ff687ca2b0821c2cacc1fa725abb3302d2af9da.zip
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/tab.go')
-rw-r--r--lib/ui/tab.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/ui/tab.go b/lib/ui/tab.go
index 4b99e4b..cd5f448 100644
--- a/lib/ui/tab.go
+++ b/lib/ui/tab.go
@@ -283,9 +283,9 @@ func (tabs *Tabs) removeHistory(index int) {
func (strip *TabStrip) Draw(ctx *Context) {
x := 0
for i, tab := range strip.Tabs {
- style := tcell.StyleDefault.Reverse(true)
+ style := strip.uiConfig.GetStyle(config.STYLE_TAB)
if strip.Selected == i {
- style = tcell.StyleDefault
+ style = strip.uiConfig.GetStyleSelected(config.STYLE_TAB)
}
tabWidth := 32
if ctx.Width()-x < tabWidth {
@@ -301,8 +301,8 @@ func (strip *TabStrip) Draw(ctx *Context) {
break
}
}
- style := tcell.StyleDefault.Reverse(true)
- ctx.Fill(x, 0, ctx.Width()-x, 1, ' ', style)
+ ctx.Fill(x, 0, ctx.Width()-x, 1, ' ',
+ strip.uiConfig.GetStyle(config.STYLE_TAB))
}
func (strip *TabStrip) Invalidate() {
@@ -386,7 +386,8 @@ func (content *TabContent) Draw(ctx *Context) {
if content.Selected >= len(content.Tabs) {
width := ctx.Width()
height := ctx.Height()
- ctx.Fill(0, 0, width, height, ' ', tcell.StyleDefault)
+ ctx.Fill(0, 0, width, height, ' ',
+ content.uiConfig.GetStyle(config.STYLE_TAB))
}
tab := content.Tabs[content.Selected]