refactor compact widgets into subpackage

This commit is contained in:
Bradley Cicenas
2017-01-06 11:51:11 +00:00
parent 3ec384414d
commit 87d5ba447b
9 changed files with 132 additions and 162 deletions

10
grid.go
View File

@@ -54,11 +54,11 @@ func (g *Grid) cursorDown() {
func (g *Grid) redrawCursor() {
for _, c := range g.containers {
if c.id == g.cursorID {
c.widgets.name.TextFgColor = ui.ColorDefault
c.widgets.name.TextBgColor = ui.ColorWhite
c.widgets.Name.TextFgColor = ui.ColorDefault
c.widgets.Name.TextBgColor = ui.ColorWhite
} else {
c.widgets.name.TextFgColor = ui.ColorWhite
c.widgets.name.TextBgColor = ui.ColorDefault
c.widgets.Name.TextFgColor = ui.ColorWhite
c.widgets.Name.TextBgColor = ui.ColorDefault
}
ui.Render(ui.Body)
}
@@ -71,7 +71,7 @@ func (g *Grid) redrawRows() {
// build layout
ui.Body.AddRows(header())
for _, c := range g.containers {
ui.Body.AddRows(c.widgets.MakeRow())
ui.Body.AddRows(c.widgets.Row())
}
ui.Body.Align()