summaryrefslogtreecommitdiff
path: root/color.go
diff options
context:
space:
mode:
Diffstat (limited to 'color.go')
-rw-r--r--color.go18
1 files changed, 5 insertions, 13 deletions
diff --git a/color.go b/color.go
index 4c9ffe6..e02e747 100644
--- a/color.go
+++ b/color.go
@@ -6,7 +6,6 @@ import (
"github.com/awesome-gocui/gocui"
"go.wit.com/log"
- "go.wit.com/toolkits/tree"
)
//w.v.SelBgColor = gocui.ColorCyan
@@ -67,10 +66,7 @@ var colorNone colorT = colorT{none, none, none, none, none, "debug none"}
// TODO: maybe enough of us could actually do that if we made it a goal.
// TODO: start with riscv boards and fix it universally there
// TODO: so just a small little 'todo' item here
-func setColor(n *tree.Node, newColor *colorT) {
- var tk *guiWidget
- tk = n.TK.(*guiWidget)
-
+func (tk *guiWidget) setColor(newColor *colorT) {
if tk.color == newColor {
// nothing to do since the colors have nto changed
return
@@ -87,15 +83,11 @@ func setColor(n *tree.Node, newColor *colorT) {
tk.recreateView()
}
-func setDefaultWidgetColor(n *tree.Node) {
- var w *guiWidget
- w = n.TK.(*guiWidget)
+func (w *guiWidget) setDefaultWidgetColor() {
w.showView()
}
-func setDefaultHighlight(n *tree.Node) {
- var w *guiWidget
- w = n.TK.(*guiWidget)
+func (w *guiWidget) setDefaultHighlight() {
if w.v == nil {
log.Log(ERROR, "SetColor() failed on view == nil")
return
@@ -117,8 +109,8 @@ func (w *guiWidget) redoColor(draw bool) {
}
log.Sleep(.05)
- setDefaultHighlight(w.node)
- setDefaultWidgetColor(w.node)
+ w.setDefaultHighlight()
+ w.setDefaultWidgetColor()
for _, child := range w.children {
child.redoColor(draw)