danaugrs 8 лет назад
Родитель
Сommit
6c0e4bf1ad
1 измененных файлов с 16 добавлено и 0 удалено
  1. 16 0
      gui/folder.go

+ 16 - 0
gui/folder.go

@@ -145,6 +145,20 @@ func (f *Folder) update() {
 	f.applyStyle(f.styles.Normal)
 }
 
+func (f *Folder) SetBgColor(c *math32.Color) {
+
+	f.styles.Normal.BgColor = *c
+	f.styles.Over.BgColor = *c
+	f.update()
+}
+
+func (f *Folder) SetFgColor(c *math32.Color) {
+
+	f.styles.Normal.FgColor = *c
+	f.styles.Over.FgColor = *c
+	f.update()
+}
+
 // applyStyle applies the specified style
 func (f *Folder) applyStyle(s *FolderStyle) {
 
@@ -159,7 +173,9 @@ func (f *Folder) applyStyle(s *FolderStyle) {
 		icode = 1
 	}
 	f.icon.SetText(string(s.Icons[icode]))
+	f.icon.SetColor(&s.FgColor)
 	f.label.SetBgColor(&s.BgColor)
+	f.label.SetColor(&s.FgColor)
 }
 
 func (f *Folder) recalc() {