mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
remove textcol coloring
This commit is contained in:
parent
05242a83f0
commit
92ca9bf7eb
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user