summaryrefslogtreecommitdiff
path: root/src/gui/progressbar.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-23 21:59:21 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-23 22:00:09 +0100
commit99e8a3fd77b63a029fe02dcf771b6af1aad252ed (patch)
tree03c296d1f89859aae35336dfe2f58df09d256fd3 /src/gui/progressbar.cpp
parentfa8a4bf49100c0a1d5b96e00803f43bbbb861100 (diff)
parent347452b9b69ef3af29c577b7751082822e900c01 (diff)
downloadmana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.gz
mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.bz2
mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.xz
mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.zip
Merge branch 'aethyra/master'
Conflicts: Many files.
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);
}
}