restructure columns in multiview

This commit is contained in:
Bradley Cicenas 2016-12-27 15:37:08 +00:00
parent b7823bda5c
commit 574bcb19fe
2 changed files with 6 additions and 6 deletions

10
grid.go
View File

@ -36,11 +36,11 @@ func (g *Grid) Cursor() {
for n, id := range g.CIDs() { for n, id := range g.CIDs() {
c := g.containers[id] c := g.containers[id]
if uint(n) == g.cursorPos { if uint(n) == g.cursorPos {
c.widgets.cid.TextFgColor = ui.ColorDefault c.widgets.name.TextFgColor = ui.ColorDefault
c.widgets.cid.TextBgColor = ui.ColorWhite c.widgets.name.TextBgColor = ui.ColorWhite
} else { } else {
c.widgets.cid.TextFgColor = ui.ColorWhite c.widgets.name.TextFgColor = ui.ColorWhite
c.widgets.cid.TextBgColor = ui.ColorDefault c.widgets.name.TextBgColor = ui.ColorDefault
} }
} }
ui.Render(ui.Body) ui.Render(ui.Body)
@ -56,11 +56,11 @@ func (g *Grid) Rows() (rows []*ui.Row) {
func header() *ui.Row { func header() *ui.Row {
return ui.NewRow( return ui.NewRow(
ui.NewCol(1, 0, headerPar("NAME")),
ui.NewCol(1, 0, headerPar("CID")), ui.NewCol(1, 0, headerPar("CID")),
ui.NewCol(2, 0, headerPar("CPU")), ui.NewCol(2, 0, headerPar("CPU")),
ui.NewCol(2, 0, headerPar("MEM")), ui.NewCol(2, 0, headerPar("MEM")),
ui.NewCol(2, 0, headerPar("NET RX/TX")), ui.NewCol(2, 0, headerPar("NET RX/TX")),
ui.NewCol(2, 0, headerPar("NAME")),
) )
} }

View File

@ -17,11 +17,11 @@ type Widgets struct {
func (w *Widgets) MakeRow() *ui.Row { func (w *Widgets) MakeRow() *ui.Row {
return ui.NewRow( return ui.NewRow(
ui.NewCol(1, 0, w.name),
ui.NewCol(1, 0, w.cid), ui.NewCol(1, 0, w.cid),
ui.NewCol(2, 0, w.cpu), ui.NewCol(2, 0, w.cpu),
ui.NewCol(2, 0, w.memory), ui.NewCol(2, 0, w.memory),
ui.NewCol(2, 0, w.net), ui.NewCol(2, 0, w.net),
ui.NewCol(2, 0, w.name),
) )
} }