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

25
cwidgets/compact/gauge.go Normal file
View File

@@ -0,0 +1,25 @@
package compact
import (
ui "github.com/gizak/termui"
)
type GaugeCol struct {
*ui.Gauge
}
func NewGaugeCol() *GaugeCol {
g := ui.NewGauge()
g.Height = 1
g.Border = false
g.Percent = 0
g.PaddingBottom = 0
g.BarColor = ui.ColorGreen
g.Label = "-"
return &GaugeCol{g}
}
func (w *GaugeCol) Reset() {
w.Label = "-"
w.Percent = 0
}