move compact field header into widgets

This commit is contained in:
Bradley Cicenas
2017-02-19 04:09:27 +00:00
parent 40085edbcc
commit 8f8474e468
3 changed files with 10 additions and 26 deletions

22
grid.go
View File

@@ -83,7 +83,7 @@ func (g *Grid) redrawRows() {
} else {
ui.Body.Y = 0
}
ui.Body.AddRows(fieldHeader())
ui.Body.AddRows(widgets.CompactHeader)
for _, c := range g.containers {
ui.Body.AddRows(c.widgets.Row())
}
@@ -117,26 +117,6 @@ func resizeIndicator() {
}
}
func fieldHeader() *ui.Row {
return ui.NewRow(
ui.NewCol(1, 0, headerPar("")),
ui.NewCol(2, 0, headerPar("NAME")),
ui.NewCol(2, 0, headerPar("CID")),
ui.NewCol(2, 0, headerPar("CPU")),
ui.NewCol(2, 0, headerPar("MEM")),
ui.NewCol(2, 0, headerPar("NET RX/TX")),
)
}
func headerPar(s string) *ui.Par {
p := ui.NewPar(fmt.Sprintf(" %s", s))
p.Border = false
p.Height = 2
p.Width = 20
p.TextFgColor = ui.ColorWhite
return p
}
func (g *Grid) ExpandView() {
ui.Clear()
ui.DefaultEvtStream.ResetHandlers()