diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-30 11:25:46 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-30 11:25:46 -0700 |
commit | 3cd6930d1417ae9cf087de8d3a9f40f053e75bf0 (patch) | |
tree | 48720f2596aca9cb4763805cd34ec1f8350b314f /src/gui/progressbar.cpp | |
parent | d57be9d49c55bc0b85eb8f539ff2029518cfafc0 (diff) | |
download | mana-client-3cd6930d1417ae9cf087de8d3a9f40f053e75bf0.tar.gz mana-client-3cd6930d1417ae9cf087de8d3a9f40f053e75bf0.tar.bz2 mana-client-3cd6930d1417ae9cf087de8d3a9f40f053e75bf0.tar.xz mana-client-3cd6930d1417ae9cf087de8d3a9f40f053e75bf0.zip |
Applied alphas to the progress bar fill and text overlays as well.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/progressbar.cpp')
-rw-r--r-- | src/gui/progressbar.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp index d9db0c3c..5e8e6655 100644 --- a/src/gui/progressbar.cpp +++ b/src/gui/progressbar.cpp @@ -113,9 +113,12 @@ void ProgressBar::draw(gcn::Graphics *graphics) static_cast<Graphics*>(graphics)-> drawImageRect(0, 0, getWidth(), getHeight(), mBorder); + const int alpha = mAlpha * 255; + // The bar if (mProgress > 0) { - graphics->setColor(gcn::Color(mRed, mGreen, mBlue, 200)); + + graphics->setColor(gcn::Color(mRed, mGreen, mBlue, alpha)); graphics->fillRectangle(gcn::Rectangle(4, 4, (int) (mProgress * (getWidth() - 8)), getHeight() - 8)); @@ -129,14 +132,16 @@ void ProgressBar::draw(gcn::Graphics *graphics) graphics->setFont(f); - graphics->setColor(gcn::Color(0, 0, 0)); + graphics->setColor(gcn::Color(0, 0, 0, alpha)); graphics->drawText(mText, textX + 1, textY, gcn::Graphics::CENTER); graphics->drawText(mText, textX, textY - 1, gcn::Graphics::CENTER); graphics->drawText(mText, textX, textY + 1, gcn::Graphics::CENTER); graphics->drawText(mText, textX - 1, textY, gcn::Graphics::CENTER); - graphics->setColor(gcn::Color(255, 255, 255)); + graphics->setColor(gcn::Color(255, 255, 255, alpha)); graphics->drawText(mText, textX, textY, gcn::Graphics::CENTER); + + graphics->setColor(gcn::Color(0, 0, 0)); } } |