diff options
Diffstat (limited to 'internal/slider')
-rw-r--r-- | internal/slider/slider.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/slider/slider.go b/internal/slider/slider.go index dbf4093..7e1b76c 100644 --- a/internal/slider/slider.go +++ b/internal/slider/slider.go @@ -34,6 +34,13 @@ func New(label byte, maxVal int, opts ...progress.Option) Model { func (m Model) Title() string { return fmt.Sprintf("%c:", m.label) } +func (m Model) Width() int { return m.progress.Width } + +func (m Model) SetWidth(w int) (tea.Model, tea.Cmd) { + m.progress.Width = w + return m, nil +} + func (m Model) Init() tea.Cmd { // Triggering a frame message Update here will force the progress bar to // render immediately. This is necessary because progress bars only render |