Whitespace

This commit is contained in:
Jonathan Daugherty 2024-10-25 19:05:06 -07:00
parent ade3f9d20e
commit d636a3b081

View File

@ -65,14 +65,14 @@ customProgressBar completeChar incompleteChar mLabel progress =
leftWidth = spacesWidth `div` 2 leftWidth = spacesWidth `div` 2
rightWidth = barWidth - labelWidth - leftWidth rightWidth = barWidth - labelWidth - leftWidth
completeWidth = round $ progress * toEnum barWidth completeWidth = round $ progress * toEnum barWidth
leftCompleteWidth = min leftWidth completeWidth leftCompleteWidth = min leftWidth completeWidth
leftIncompleteWidth = leftWidth - leftCompleteWidth leftIncompleteWidth = leftWidth - leftCompleteWidth
leftPart = replicate leftCompleteWidth completeChar ++ replicate leftIncompleteWidth incompleteChar leftPart = replicate leftCompleteWidth completeChar ++ replicate leftIncompleteWidth incompleteChar
rightCompleteWidth = max 0 (completeWidth - labelWidth - leftWidth) rightCompleteWidth = max 0 (completeWidth - labelWidth - leftWidth)
rightIncompleteWidth = rightWidth - rightCompleteWidth rightIncompleteWidth = rightWidth - rightCompleteWidth
rightPart = replicate rightCompleteWidth completeChar ++ replicate rightIncompleteWidth incompleteChar rightPart = replicate rightCompleteWidth completeChar ++ replicate rightIncompleteWidth incompleteChar
fullBar = leftPart <> label <> rightPart fullBar = leftPart <> label <> rightPart
adjustedCompleteWidth = if completeWidth == length fullBar && progress < 1.0 adjustedCompleteWidth = if completeWidth == length fullBar && progress < 1.0
then completeWidth - 1 then completeWidth - 1