feat(config): add theme.active_title_color field

This commit is contained in:
ayn2op 2025-03-30 10:59:32 -04:00
parent 19cf4335e9
commit 5932b66e53
5 changed files with 21 additions and 10 deletions

View file

@ -45,9 +45,11 @@ func newGuildsTree(app *tview.Application, cfg *config.Config) *GuildsTree {
SetBorderPadding(p[0], p[1], p[2], p[3]).
SetFocusFunc(func() {
gt.SetBorderColor(tcell.GetColor(b.ActiveColor))
gt.SetTitleColor(tcell.GetColor(t.ActiveTitleColor))
}).
SetBlurFunc(func() {
gt.SetBorderColor(tcell.GetColor(b.Color))
gt.SetTitleColor(tcell.GetColor(t.TitleColor))
})
return gt

View file

@ -51,9 +51,11 @@ func newMessageInput(app *tview.Application, cfg *config.Config) *MessageInput {
SetBorderPadding(p[0], p[1], p[2], p[3]).
SetFocusFunc(func() {
mi.SetBorderColor(tcell.GetColor(b.ActiveColor))
mi.SetTitleColor(tcell.GetColor(t.ActiveTitleColor))
}).
SetBlurFunc(func() {
mi.SetBorderColor(tcell.GetColor(b.Color))
mi.SetTitleColor(tcell.GetColor(t.TitleColor))
})
return mi

View file

@ -60,9 +60,11 @@ func newMessagesText(app *tview.Application, cfg *config.Config) *MessagesText {
SetBorderPadding(p[0], p[1], p[2], p[3]).
SetFocusFunc(func() {
mt.SetBorderColor(tcell.GetColor(b.ActiveColor))
mt.SetTitleColor(tcell.GetColor(t.ActiveTitleColor))
}).
SetBlurFunc(func() {
mt.SetBorderColor(tcell.GetColor(b.Color))
mt.SetTitleColor(tcell.GetColor(t.TitleColor))
})
markdown.DefaultRenderer.AddOptions(

View file

@ -39,7 +39,6 @@ var (
}
tview.Styles.PrimitiveBackgroundColor = tcell.GetColor(cfg.Theme.BackgroundColor)
tview.Styles.TitleColor = tcell.GetColor(cfg.Theme.TitleColor)
tview.Borders.Horizontal = cfg.Theme.Border.Preset.Horizontal
tview.Borders.Vertical = cfg.Theme.Border.Preset.Vertical

View file

@ -61,17 +61,21 @@ type (
Enabled bool `toml:"enabled"`
Padding [4]int `toml:"padding"`
Color string `toml:"color"`
ActiveColor string `toml:"active_color"`
Preset BorderPreset `toml:"preset"`
Color string `toml:"color"`
ActiveColor string `toml:"active_color"`
Preset BorderPreset `toml:"preset"`
}
Theme struct {
TitleColor string `toml:"title_color"`
BackgroundColor string `toml:"background_color"`
Border BorderTheme `toml:"border"`
GuildsTree GuildsTreeTheme `toml:"guilds_tree"`
MessagesText MessagesTextTheme `toml:"messages_text"`
BackgroundColor string `toml:"background_color"`
TitleColor string `toml:"title_color"`
ActiveTitleColor string `toml:"active_title_color"`
Border BorderTheme `toml:"border"`
GuildsTree GuildsTreeTheme `toml:"guilds_tree"`
MessagesText MessagesTextTheme `toml:"messages_text"`
}
GuildsTreeTheme struct {
@ -113,7 +117,9 @@ func defaultTheme() Theme {
},
BackgroundColor: "default",
TitleColor: "default",
TitleColor: "default",
ActiveTitleColor: "green",
GuildsTree: GuildsTreeTheme{
AutoExpandFolders: true,