mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-01-11 14:38:10 +03:00
Add functional argument for setting the width of the progress bar
This commit is contained in:
parent
47b8d9c6a8
commit
5d6d8cb0fb
@ -60,6 +60,15 @@ func WithoutPercentage() Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithWidth sets the initial width of the progress bar. Note that you can also
|
||||
// set the width via the Width property, which can come in handy if you're
|
||||
// waiting for a tea.WindowSizeMsg.
|
||||
func WithWidth(w int) Option {
|
||||
return func(m *Model) {
|
||||
m.Width = w
|
||||
}
|
||||
}
|
||||
|
||||
// Model stores values we'll use when rendering the progress bar.
|
||||
type Model struct {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user