Skip to content

Commit

Permalink
Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jtdaugherty committed Oct 26, 2024
1 parent ade3f9d commit d636a3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Brick/Widgets/ProgressBar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ customProgressBar completeChar incompleteChar mLabel progress =
leftWidth = spacesWidth `div` 2
rightWidth = barWidth - labelWidth - leftWidth
completeWidth = round $ progress * toEnum barWidth

leftCompleteWidth = min leftWidth completeWidth
leftIncompleteWidth = leftWidth - leftCompleteWidth
leftPart = replicate leftCompleteWidth completeChar ++ replicate leftIncompleteWidth incompleteChar
rightCompleteWidth = max 0 (completeWidth - labelWidth - leftWidth)
rightIncompleteWidth = rightWidth - rightCompleteWidth
rightPart = replicate rightCompleteWidth completeChar ++ replicate rightIncompleteWidth incompleteChar

fullBar = leftPart <> label <> rightPart
adjustedCompleteWidth = if completeWidth == length fullBar && progress < 1.0
then completeWidth - 1
Expand Down

0 comments on commit d636a3b

Please sign in to comment.