diff --git a/ui_tree.go b/ui_tree.go index 25c42af..9de145b 100644 --- a/ui_tree.go +++ b/ui_tree.go @@ -20,9 +20,7 @@ func (ti TreeItem) String() string { return "" } -func (ti TreeItem) TreeItemStyle(active bool) (uiterm.Attribute, uiterm.Attribute) { - fg := uiterm.ColorDefault - bg := uiterm.ColorBlack +func (ti TreeItem) TreeItemStyle(fg, bg uiterm.Attribute, active bool) (uiterm.Attribute, uiterm.Attribute) { if ti.Channel != nil { fg |= uiterm.AttrBold } diff --git a/uiterm/tree.go b/uiterm/tree.go index 7bac2ad..0ac3fe0 100644 --- a/uiterm/tree.go +++ b/uiterm/tree.go @@ -7,7 +7,7 @@ import ( ) type TreeItem interface { - TreeItemStyle(active bool) (Attribute, Attribute) + TreeItemStyle(fg, bg Attribute, active bool) (Attribute, Attribute) String() string } @@ -122,7 +122,7 @@ func (t *Tree) uiDraw() { if reader != nil && level*2 <= dx { if ch, _, err := reader.ReadRune(); err == nil { chr = ch - fg, bg = item.TreeItemStyle(t.active && t.activeLine == dy) + fg, bg = item.TreeItemStyle(fg, bg, t.active && t.activeLine == dy) } } termbox.SetCell(x, y, chr, termbox.Attribute(fg), termbox.Attribute(bg))