MCPcopy
hub / github.com/wtfutil/wtf / buildProgressBar

Method buildProgressBar

modules/progress/widget.go:161–178  ·  view source on GitHub ↗
(percent string)

Source from the content-addressed store, hash-verified

159}
160
161func (widget *Widget) buildProgressBar(percent string) *progress.Model {
162 pOpts := []progress.Option{
163 progress.WithWidth(widget.calcBarWidth(percent)),
164 progress.WithoutPercentage(),
165 }
166
167 if widget.settings.solid != "" {
168 pOpts = append(pOpts, progress.WithSolidFill(widget.settings.solid))
169 } else {
170 pOpts = append(pOpts, progress.WithGradient(
171 widget.settings.gradientA,
172 widget.settings.gradientB,
173 ))
174 }
175
176 pb := progress.New(pOpts...)
177 return &pb
178}
179
180func (widget *Widget) calcPercent() {
181 if widget.maximum == 0 {

Callers 1

contentMethod · 0.95

Calls 1

calcBarWidthMethod · 0.95

Tested by

no test coverage detected