diff options
author | Reto Brunner <reto@labrat.space> | 2020-05-27 07:37:02 +0200 |
---|---|---|
committer | Reto Brunner <reto@labrat.space> | 2020-05-27 07:57:10 +0200 |
commit | 0f78f06610c0e8887aba2ae50e99b86477a384b3 (patch) | |
tree | ff4cd6581d3af0911954a37550602366d2bb0e2f /widgets/spinner.go | |
parent | 6c4ed3cfe2fe66a1e5f26c404ea90e048142db72 (diff) | |
download | aerc-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 'widgets/spinner.go')
-rw-r--r-- | widgets/spinner.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/widgets/spinner.go b/widgets/spinner.go index 51b8c1b0..0c724221 100644 --- a/widgets/spinner.go +++ b/widgets/spinner.go @@ -16,6 +16,7 @@ type Spinner struct { frame int64 // access via atomic frames []string stop chan struct{} + style tcell.Style } func NewSpinner(uiConf *config.UIConfig) *Spinner { @@ -23,6 +24,7 @@ func NewSpinner(uiConf *config.UIConfig) *Spinner { stop: make(chan struct{}), frame: -1, frames: strings.Split(uiConf.Spinner, uiConf.SpinnerDelimiter), + style: uiConf.GetStyle(config.STYLE_SPINNER), } return &spinner } @@ -70,9 +72,9 @@ func (s *Spinner) Draw(ctx *ui.Context) { cur := int(atomic.LoadInt64(&s.frame) % int64(len(s.frames))) - ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', tcell.StyleDefault) + ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', s.style) col := ctx.Width()/2 - len(s.frames[0])/2 + 1 - ctx.Printf(col, 0, tcell.StyleDefault, "%s", s.frames[cur]) + ctx.Printf(col, 0, s.style, "%s", s.frames[cur]) } func (s *Spinner) Invalidate() { |