refactor all container widgets into subpackage

This commit is contained in:
Bradley Cicenas
2017-02-26 22:04:24 +00:00
parent 4aaf26b63d
commit 70f2648952
14 changed files with 348 additions and 317 deletions

View File

@@ -4,11 +4,12 @@ import (
"fmt"
"github.com/bcicen/ctop/config"
"github.com/bcicen/ctop/cwidgets/compact"
"github.com/bcicen/ctop/widgets"
ui "github.com/gizak/termui"
)
var cGrid = widgets.NewCompactGrid()
var cGrid = compact.NewCompactGrid()
func maxRows() int {
return ui.TermHeight() - 2 - cGrid.Y
@@ -85,7 +86,7 @@ func (g *Grid) cursorDown() {
func (g *Grid) redrawRows() {
// reinit body rows
cGrid.Rows = []widgets.ContainerWidgets{}
cGrid.Clear()
// build layout
y := 1