add custom label formatting, scale for expandedMem

This commit is contained in:
Bradley Cicenas
2017-01-08 18:07:56 +00:00
parent 72066aba6e
commit e73732ae98
5 changed files with 36 additions and 37 deletions

View File

@@ -30,8 +30,8 @@ func NewCompact(id string, name string) *Compact {
Cid: compactPar(id),
Net: compactPar("-"),
Name: compactPar(name),
Cpu: mkGauge(),
Memory: mkGauge(),
Cpu: slimGauge(),
Memory: slimGauge(),
}
}
@@ -82,3 +82,14 @@ func (w *Compact) SetMem(val int64, limit int64, percent int) {
}
w.Memory.Percent = percent
}
func slimGauge() *ui.Gauge {
g := ui.NewGauge()
g.Height = 1
g.Border = false
g.Percent = 0
g.PaddingBottom = 0
g.BarColor = ui.ColorGreen
g.Label = "-"
return g
}