status: fix drawing progressbar if third character was not specified

This commit is contained in:
Andrzej Rybczak
2010-08-24 17:29:26 +02:00
parent 80d6b36917
commit 0db01b7429

View File

@@ -655,10 +655,16 @@ void DrawProgressbar(unsigned elapsed, unsigned time)
{ {
unsigned pb_width = wFooter->GetWidth(); unsigned pb_width = wFooter->GetWidth();
unsigned howlong = time ? pb_width*elapsed/time : 0; unsigned howlong = time ? pb_width*elapsed/time : 0;
*wFooter << fmtBold << Config.progressbar_color << XY(0, 0); *wFooter << fmtBold << Config.progressbar_color;
if (Config.progressbar[2] != '\0')
{
wFooter->GotoXY(0, 0);
for (unsigned i = 0; i < pb_width; ++i) for (unsigned i = 0; i < pb_width; ++i)
*wFooter << Config.progressbar[2]; *wFooter << Config.progressbar[2];
wFooter->GotoXY(0, 0); wFooter->GotoXY(0, 0);
}
else
mvwhline(wFooter->Raw(), 0, 0, 0, pb_width);
if (time) if (time)
{ {
pb_width = std::min(size_t(howlong), wFooter->GetWidth()); pb_width = std::min(size_t(howlong), wFooter->GetWidth());