Эх сурвалжийг харах

Add background color to ThemeConfig

ayn2op 3 жил өмнө
parent
commit
087e4391ed
4 өөрчлөгдсөн 12 нэмэгдсэн , 4 устгасан
  1. 4 2
      config.go
  2. 3 1
      guilds_tree.go
  3. 3 1
      message_input.go
  4. 2 0
      messages_text.go

+ 4 - 2
config.go

@@ -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{

+ 3 - 1
guilds_tree.go

@@ -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

+ 3 - 1
message_input.go

@@ -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

+ 2 - 0
messages_text.go

@@ -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)