remove textcol coloring

This commit is contained in:
Bradley Cicenas 2017-08-28 01:48:13 +00:00
parent 05242a83f0
commit 92ca9bf7eb

View File

@ -6,7 +6,6 @@ import (
type TextCol struct {
*ui.Par
isHighlight bool
}
func NewTextCol(s string) *TextCol {
@ -14,23 +13,17 @@ func NewTextCol(s string) *TextCol {
p.Border = false
p.Height = 1
p.Width = 20
return &TextCol{p, false}
return &TextCol{p}
}
func (w *TextCol) Highlight() {
if w.TextFgColor == ui.ThemeAttr("par.text.fg") {
w.TextFgColor = ui.ThemeAttr("par.text.hi")
}
w.TextFgColor = ui.ThemeAttr("par.text.hi")
w.TextBgColor = ui.ThemeAttr("par.text.fg")
w.isHighlight = true
}
func (w *TextCol) UnHighlight() {
if w.TextFgColor == ui.ThemeAttr("par.text.hi") {
w.TextFgColor = ui.ThemeAttr("par.text.fg")
}
w.TextFgColor = ui.ThemeAttr("par.text.fg")
w.TextBgColor = ui.ThemeAttr("par.text.bg")
w.isHighlight = false
}
func (w *TextCol) Reset() {
@ -40,19 +33,3 @@ func (w *TextCol) Reset() {
func (w *TextCol) Set(s string) {
w.Text = s
}
func (w *TextCol) Color(s string) {
color := ui.ThemeAttr("par.text.fg")
if w.isHighlight {
color = ui.ThemeAttr("par.text.hi")
}
switch s {
case "healthy":
color = ui.ThemeAttr("status.ok")
case "unhealthy":
color = ui.ThemeAttr("status.danger")
case "starting":
color = ui.ThemeAttr("status.warn")
}
w.TextFgColor = color
}