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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user