Drawing of the progress bar has been improved

This commit is contained in:
Markus Gans 2019-02-25 23:35:27 +01:00
parent cefd894c40
commit e3fb0c4a56
1 changed files with 4 additions and 7 deletions

View File

@ -161,8 +161,7 @@ void FProgressbar::drawProgressLabel()
void FProgressbar::drawProgressBar() void FProgressbar::drawProgressBar()
{ {
std::size_t len = 0; std::size_t len = 0;
print() << FPoint(1, 1) print() << FPoint(1, 1);
<< FColorPair(wc.progressbar_bg, wc.progressbar_fg);
if ( percentage > 0 && percentage <= 100 ) if ( percentage > 0 && percentage <= 100 )
len = drawProgressIndicator(); len = drawProgressIndicator();
@ -182,14 +181,12 @@ std::size_t FProgressbar::drawProgressIndicator()
// Draw the progress indicator // Draw the progress indicator
if ( isMonochron() ) if ( isMonochron() )
setReverse(false); setReverse(true);
double length = double(bar_length * percentage) / 100; double length = double(bar_length * percentage) / 100;
auto len = std::size_t(trunc(length)); auto len = std::size_t(trunc(length));
print() << FString (len, L' '); print() << FColorPair (wc.progressbar_fg, wc.progressbar_fg)
<< FString (len, fc::FullBlock); // █
if ( isMonochron() )
setReverse(true);
if ( len >= bar_length ) if ( len >= bar_length )
return len; return len;