1
0
Fork 0

Spinner color config option

This commit is contained in:
BreadMakesYouFat 2023-06-24 20:57:20 -04:00 committed by squdle
parent f0ac5c9648
commit ea4db9f890
3 changed files with 10 additions and 1 deletions

View File

@ -51,6 +51,7 @@ type Config struct {
Theme struct {
Header struct {
Selector ThemeItemConfig
Spinner ThemeItemConfig
}
DialogBox struct {
@ -209,6 +210,10 @@ func SetDefaults(cacheDir string) {
viper.SetDefault("Theme.Header.Selector.Foreground",
lipgloss.AdaptiveColor{Light: "#6ca1d0", Dark: "#6ca1d0"})
// Header Spinner
viper.SetDefault("Theme.Header.Spinner",
lipgloss.AdaptiveColor{Light: "#FF5FAF", Dark: "#FF5FAF"})
// --- DialogBox ---
// DialogBox Window:Focused
viper.SetDefault("Theme.DialogBox.Window.Focused.Margin",

View File

@ -36,7 +36,8 @@ func NewModel(c *ctx.Ctx) Model {
m.spinner = spinner.New()
m.spinner.Spinner = spinner.Dot
m.spinner.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("205"))
m.spinner.Style = lipgloss.NewStyle().Foreground(
m.ctx.Theme.Header.Spinner.GetForeground())
return m
}

View File

@ -8,6 +8,7 @@ import (
type Theme struct {
Header struct {
Selector lipgloss.Style
Spinner lipgloss.Style
}
DialogBox struct {
@ -83,6 +84,8 @@ func New(cfg *config.Config) *Theme {
t.Header.Selector =
t.fromConfig(&cfg.Theme.Header.Selector)
t.Header.Spinner =
t.fromConfig(&cfg.Theme.Header.Spinner)
t.DialogBox.Window.Focused =
t.fromConfig(&cfg.Theme.DialogBox.Window.Focused)