aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/dirlist.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 /widgets/dirlist.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 'widgets/dirlist.go')
-rw-r--r--widgets/dirlist.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index 37115444..3ed79ccf 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -196,7 +196,8 @@ func (dirlist *DirectoryList) getRUEString(name string) string {
}
func (dirlist *DirectoryList) Draw(ctx *ui.Context) {
- ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', tcell.StyleDefault)
+ ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ',
+ dirlist.UiConfig().GetStyle(config.STYLE_DIRLIST_DEFAULT))
if dirlist.spinner.IsRunning() {
dirlist.spinner.Draw(ctx)
@@ -204,7 +205,7 @@ func (dirlist *DirectoryList) Draw(ctx *ui.Context) {
}
if len(dirlist.dirs) == 0 {
- style := tcell.StyleDefault
+ style := dirlist.UiConfig().GetStyle(config.STYLE_DIRLIST_DEFAULT)
ctx.Printf(0, 0, style, dirlist.UiConfig().EmptyDirlist)
return
}
@@ -236,10 +237,7 @@ func (dirlist *DirectoryList) Draw(ctx *ui.Context) {
style := tcell.StyleDefault
if name == dirlist.selected {
- style = style.Reverse(true)
- } else if name == dirlist.selecting {
- style = style.Reverse(true)
- style = style.Foreground(tcell.ColorGray)
+ style = dirlist.UiConfig().GetStyleSelected(config.STYLE_DIRLIST_DEFAULT)
}
ctx.Fill(0, row, textWidth, 1, ' ', style)