Add background color to ThemeConfig

This commit is contained in:
ayn2op 2023-01-07 14:20:20 +05:30
parent 95df8371e9
commit 087e4391ed
4 changed files with 12 additions and 4 deletions

View file

@ -36,7 +36,8 @@ type (
Border bool `yaml:"border"`
BorderPadding [4]int `yaml:"border_padding,flow"`
TitleColor string `yaml:"title_color"`
TitleColor string `yaml:"title_color"`
BackgroundColor string `yaml:"background_color"`
}
GuildsTreeThemeConfig struct {
@ -83,7 +84,8 @@ func newConfig() (*Config, error) {
Border: true,
BorderPadding: [...]int{0, 0, 1, 1},
TitleColor: "default",
TitleColor: "default",
BackgroundColor: "default",
}
commonKeys := CommonKeysConfig{

View file

@ -29,8 +29,10 @@ func newGuildsTree() *GuildsTree {
gt.SetTopLevel(1)
gt.SetSelectedFunc(gt.onSelected)
gt.SetBackgroundColor(tcell.GetColor(cfg.Theme.GuildsTree.BackgroundColor))
gt.SetTitle("Guilds")
gt.SetTitleColor(tcell.GetColor(cfg.Theme.MessagesText.TitleColor))
gt.SetTitleColor(tcell.GetColor(cfg.Theme.GuildsTree.TitleColor))
gt.SetTitleAlign(tview.AlignLeft)
padding := cfg.Theme.GuildsTree.BorderPadding

View file

@ -23,7 +23,9 @@ func newMessageInput() *MessageInput {
mi.SetFieldBackgroundColor(tview.Styles.PrimitiveBackgroundColor)
mi.SetInputCapture(mi.onInputCapture)
mi.SetTitleColor(tcell.GetColor(cfg.Theme.MessagesText.TitleColor))
mi.SetBackgroundColor(tcell.GetColor(cfg.Theme.MessageInput.BackgroundColor))
mi.SetTitleColor(tcell.GetColor(cfg.Theme.MessageInput.TitleColor))
mi.SetTitleAlign(tview.AlignLeft)
padding := cfg.Theme.MessageInput.BorderPadding

View file

@ -28,6 +28,8 @@ func newMessagesText() *MessagesText {
mt.SetHighlightedFunc(mt.onHighlighted)
mt.SetInputCapture(mt.onInputCapture)
mt.SetBackgroundColor(tcell.GetColor(cfg.Theme.MessagesText.BackgroundColor))
mt.SetTitle("Messages")
mt.SetTitleColor(tcell.GetColor(cfg.Theme.MessagesText.TitleColor))
mt.SetTitleAlign(tview.AlignLeft)