convert expanded mem widget to mbarchart, add innerlabel

This commit is contained in:
Bradley Cicenas
2017-03-06 23:58:04 +00:00
parent d94aed1531
commit 8e995a37c6
4 changed files with 97 additions and 44 deletions

View File

@@ -9,14 +9,14 @@ import (
var (
log = logging.Init()
sizeError = termSizeError()
colWidth = [2]int{60, 0} // left,right column width
colWidth = [2]int{65, 0} // left,right column width
)
type Expanded struct {
Info *Info
Net *ExpandedNet
Cpu *ExpandedCpu
Mem *ExpandedMem
Net *Net
Cpu *Cpu
Mem *Mem
Width int
}
@@ -26,9 +26,9 @@ func NewExpanded(id string) *Expanded {
}
return &Expanded{
Info: NewInfo(id),
Net: NewExpandedNet(),
Cpu: NewExpandedCpu(),
Mem: NewExpandedMem(),
Net: NewNet(),
Cpu: NewCpu(),
Mem: NewMem(),
Width: ui.TermWidth(),
}
}
@@ -56,6 +56,7 @@ func (e *Expanded) Align() {
if e.Width > colWidth[0] {
colWidth[1] = e.Width - (colWidth[0] + 1)
}
e.Mem.Align()
log.Debugf("align: width=%v left-col=%v right-col=%v", e.Width, colWidth[0], colWidth[1])
}