New progressBar Primitive

Previous Implementation of progressBar wasn't clean and for a long time
I wanted to make progressBar a Primitive. Which also makes it project
agnostic.

Following changes have been made:

1. Moved `utils.GetText` to `ui.GetProgressGlyph` (As it had no use other
   than for the progressBar
2. Removed the old Implementation of progressBar

How progressBar works as of right now:

All the Values for the progressBar are provided through the
ProgressFunction()

The ProgressFunction should return
Title (Bar's Title), TopText (Box's Title), BarText (The Text Inside the
progressBar), Percentage(Float64 representing the progress Percentage)
This commit is contained in:
aditya-K2
2022-08-29 17:36:36 +05:30
parent 429db5b1e7
commit d7044c48b1
3 changed files with 73 additions and 77 deletions

View File

@@ -58,16 +58,6 @@ func InsertAt(inputString, stringTobeInserted string, index int) string {
return s
}
func GetText(width, percentage float64, eta string) string {
q := "[black:white:b]"
var a string
a += strings.Repeat(" ", int(width)-len(eta))
a = InsertAt(a, eta, int(width/2)-10)
a = InsertAt(a, "[-:-:-]", int(width*percentage/100))
q += a
return q
}
func ConvertToArray(ArtistTree map[string]map[string]map[string]string) []string {
var p []string
for k2, v := range ArtistTree {