1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-11-03 04:27:16 -05:00

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 { Theme struct {
Header struct { Header struct {
Selector ThemeItemConfig Selector ThemeItemConfig
Spinner ThemeItemConfig
} }
DialogBox struct { DialogBox struct {
@ -209,6 +210,10 @@ func SetDefaults(cacheDir string) {
viper.SetDefault("Theme.Header.Selector.Foreground", viper.SetDefault("Theme.Header.Selector.Foreground",
lipgloss.AdaptiveColor{Light: "#6ca1d0", Dark: "#6ca1d0"}) lipgloss.AdaptiveColor{Light: "#6ca1d0", Dark: "#6ca1d0"})
// Header Spinner
viper.SetDefault("Theme.Header.Spinner",
lipgloss.AdaptiveColor{Light: "#FF5FAF", Dark: "#FF5FAF"})
// --- DialogBox --- // --- DialogBox ---
// DialogBox Window:Focused // DialogBox Window:Focused
viper.SetDefault("Theme.DialogBox.Window.Focused.Margin", 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.New()
m.spinner.Spinner = spinner.Dot 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 return m
} }

View File

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