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:
commit
ecfd936650
@ -53,6 +53,7 @@ type Config struct {
|
||||
Theme struct {
|
||||
Header struct {
|
||||
Selector ThemeItemConfig
|
||||
Spinner ThemeItemConfig
|
||||
}
|
||||
|
||||
DialogBox struct {
|
||||
@ -213,6 +214,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",
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user