From 0db01b7429987c94d521b116a045a1449cd50a0d Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Tue, 24 Aug 2010 17:29:26 +0200 Subject: [PATCH] status: fix drawing progressbar if third character was not specified --- src/status.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/status.cpp b/src/status.cpp index 8c3bd33e..c93b6186 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -655,10 +655,16 @@ void DrawProgressbar(unsigned elapsed, unsigned time) { unsigned pb_width = wFooter->GetWidth(); unsigned howlong = time ? pb_width*elapsed/time : 0; - *wFooter << fmtBold << Config.progressbar_color << XY(0, 0); - for (unsigned i = 0; i < pb_width; ++i) - *wFooter << Config.progressbar[2]; - wFooter->GotoXY(0, 0); + *wFooter << fmtBold << Config.progressbar_color; + if (Config.progressbar[2] != '\0') + { + wFooter->GotoXY(0, 0); + for (unsigned i = 0; i < pb_width; ++i) + *wFooter << Config.progressbar[2]; + wFooter->GotoXY(0, 0); + } + else + mvwhline(wFooter->Raw(), 0, 0, 0, pb_width); if (time) { pb_width = std::min(size_t(howlong), wFooter->GetWidth());