summaryrefslogtreecommitdiff
path: root/src/gui/progressbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/progressbar.cpp')
-rw-r--r--src/gui/progressbar.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp
index f0acfecf..58d7d815 100644
--- a/src/gui/progressbar.cpp
+++ b/src/gui/progressbar.cpp
@@ -22,6 +22,7 @@
#include <guichan/font.hpp>
#include "gui.h"
+#include "palette.h"
#include "progressbar.h"
#include "textrenderer.h"
@@ -35,8 +36,6 @@ ImageRect ProgressBar::mBorder;
int ProgressBar::mInstances = 0;
float ProgressBar::mAlpha = config.getValue("guialpha", 0.8);
-const gcn::Color ProgressBar::TEXT_COLOR = gcn::Color(255, 255, 255);
-
ProgressBar::ProgressBar(float progress,
unsigned int width, unsigned int height,
Uint8 red, Uint8 green, Uint8 blue):
@@ -121,23 +120,22 @@ void ProgressBar::draw(gcn::Graphics *graphics)
// The bar
if (mProgress > 0)
{
-
graphics->setColor(gcn::Color(mRed, mGreen, mBlue, alpha));
graphics->fillRectangle(gcn::Rectangle(4, 4,
- (int) (mProgress * (getWidth() - 8)),
- getHeight() - 8));
+ (int) (mProgress * (getWidth() - 8)),
+ getHeight() - 8));
}
// The label
if (!mText.empty())
{
- gcn::Font *f = boldFont;
- int textX = getWidth() / 2;
- int textY = (getHeight() - f->getHeight()) / 2;
+ const int textX = getWidth() / 2;
+ const int textY = (getHeight() - boldFont->getHeight()) / 2;
TextRenderer::renderText(graphics, mText, textX, textY,
- gcn::Graphics::CENTER, &TEXT_COLOR, f, true,
- false);
+ gcn::Graphics::CENTER,
+ guiPalette->getColor(Palette::PROGRESS_BAR,
+ alpha), boldFont, true, false);
}
}