diff --git a/cwidgets/compact/text.go b/cwidgets/compact/text.go index 1158281..b8bc8cf 100644 --- a/cwidgets/compact/text.go +++ b/cwidgets/compact/text.go @@ -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 -}