From c60d87ab6ac8aa2860de61620ea6054e21e1c322 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 21 Aug 2023 15:11:25 -0400 Subject: [PATCH 1/2] feat(progress): make full/empty fill characters configurable --- progress/progress.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/progress/progress.go b/progress/progress.go index 871d35dc..3ebdd1d9 100644 --- a/progress/progress.go +++ b/progress/progress.go @@ -79,6 +79,14 @@ func WithSolidFill(color string) Option { } } +// WithCustomFillCharacters sets the characters used to construct the full and empty components of the progress bar. +func WithCustomFillCharacters(full rune, empty rune) Option { + return func(m *Model) { + m.Full = full + m.Empty = empty + } +} + // WithoutPercentage hides the numeric percentage. func WithoutPercentage() Option { return func(m *Model) { From e95639e5179e0f3bbf22671a9d2b1dc86ced993a Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Fri, 3 Nov 2023 12:34:47 -0400 Subject: [PATCH 2/2] Rename WithCustomFillCharacters to WithFillCharacters --- progress/progress.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/progress/progress.go b/progress/progress.go index 3ebdd1d9..d5a4c5a1 100644 --- a/progress/progress.go +++ b/progress/progress.go @@ -79,8 +79,8 @@ func WithSolidFill(color string) Option { } } -// WithCustomFillCharacters sets the characters used to construct the full and empty components of the progress bar. -func WithCustomFillCharacters(full rune, empty rune) Option { +// WithFillCharacters sets the characters used to construct the full and empty components of the progress bar. +func WithFillCharacters(full rune, empty rune) Option { return func(m *Model) { m.Full = full m.Empty = empty