refactor widgets, add wrapper structs

This commit is contained in:
Bradley Cicenas
2017-03-03 07:57:26 +00:00
parent 9f5cd42b73
commit 56be64367b
12 changed files with 249 additions and 195 deletions

View File

@@ -14,32 +14,14 @@ func calcWidth(width, items int) int {
}
func slimHeaderPar(s string) *ui.Par {
p := slimPar(s)
p := ui.NewPar(s)
p.Y = 2
p.Height = 2
return p
}
func slimPar(s string) *ui.Par {
p := ui.NewPar(s)
p.Border = false
p.Height = 1
p.Width = 20
p.TextFgColor = ui.ColorWhite
p.Border = false
return p
}
func slimGauge() *ui.Gauge {
g := ui.NewGauge()
g.Height = 1
g.Border = false
g.Percent = 0
g.PaddingBottom = 0
g.BarColor = ui.ColorGreen
g.Label = "-"
return g
}
func centerParText(p *ui.Par) {
var text string
var padding string