Преглед изворни кода

fixed gui.Tree styles update

leonsal пре 8 година
родитељ
комит
5f8c197fd0
2 измењених фајлова са 6 додато и 3 уклоњено
  1. 2 2
      gui/style.go
  2. 4 1
      gui/tree.go

+ 2 - 2
gui/style.go

@@ -548,7 +548,7 @@ func setupDefaultStyle() {
 				Border:      BorderSizes{0, 0, 0, 0},
 				Paddings:    BorderSizes{0, 0, 0, 0},
 				BorderColor: borderColor,
-				BgColor:     bgColor,
+				BgColor:     bgColor4,
 				FgColor:     fgColor,
 				Icons:       [2]int{assets.ExpandMore, assets.ExpandLess},
 			},
@@ -663,7 +663,7 @@ func setupDefaultStyle() {
 					Border:      BorderSizes{0, 0, 0, 0},
 					Paddings:    BorderSizes{0, 0, 0, 0},
 					BorderColor: borderColor,
-					BgColor:     bgColor,
+					BgColor:     bgColor4,
 					FgColor:     fgColor,
 					Icons:       [2]int{assets.ExpandMore, assets.ExpandLess},
 				},

+ 4 - 1
gui/tree.go

@@ -29,7 +29,7 @@ type TreeNodeStyle struct {
 	Border      BorderSizes
 	Paddings    BorderSizes
 	BorderColor math32.Color4
-	BgColor     math32.Color
+	BgColor     math32.Color4
 	FgColor     math32.Color
 	Icons       [2]int
 }
@@ -365,11 +365,14 @@ func (n *TreeNode) applyStyle(s *TreeNodeStyle) {
 	n.SetMarginsFrom(&s.Margins)
 	n.SetBordersColor4(&s.BorderColor)
 	n.SetBordersFrom(&s.Border)
+	n.SetColor4(&s.BgColor)
 	icode := 0
 	if n.expanded {
 		icode = 1
 	}
 	n.icon.SetText(string(s.Icons[icode]))
+	n.icon.SetColor(&s.FgColor)
+	n.label.SetColor(&s.FgColor)
 }
 
 // update updates this tree node style