1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-12-04 14:46:37 -05:00

Merge pull request #40 from BreadMakesYouFat/spinner-color

Spinner color from config
This commit is contained in:
mrusme 2023-06-25 15:34:35 -05:00 committed by GitHub
commit ecfd936650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -53,6 +53,7 @@ type Config struct {
Theme struct { Theme struct {
Header struct { Header struct {
Selector ThemeItemConfig Selector ThemeItemConfig
Spinner ThemeItemConfig
} }
DialogBox struct { DialogBox struct {
@ -213,6 +214,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)