mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
refactor widgets, add wrapper structs
This commit is contained in:
25
cwidgets/compact/gauge.go
Normal file
25
cwidgets/compact/gauge.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user