restructure compact widgets

This commit is contained in:
Bradley Cicenas
2017-03-06 00:15:32 +00:00
parent 3172f141f9
commit 52a3e61b92
7 changed files with 121 additions and 109 deletions

View File

@@ -7,21 +7,14 @@ import (
ui "github.com/gizak/termui"
)
const colSpacing = 1
// Calculate per-column width, given total width and number of items
func calcWidth(width, items int) int {
spacing := colSpacing * items
return (width - statusWidth - spacing) / items
}
func slimHeaderPar(s string) *ui.Par {
p := ui.NewPar(s)
p.Y = 2
p.Height = 2
p.Width = 20
p.Border = false
return p
}
func centerParText(p *ui.Par) {
var text string
var padding string