From 20ad38045482254b9875ee80de44a9b6f9367d2d Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Sat, 14 Mar 2009 14:28:26 -0600 Subject: Exposed the progress bar colors to the color management tab. Signed-off-by: Ira Rice --- src/gui/widgets/textpreview.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/gui/widgets/textpreview.cpp') diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp index e34bb5cb..5408eebe 100644 --- a/src/gui/widgets/textpreview.cpp +++ b/src/gui/widgets/textpreview.cpp @@ -35,6 +35,7 @@ float TextPreview::mAlpha = config.getValue("guialpha", 0.8); TextPreview::TextPreview(const std::string* text) { mText = text; + mTextAlpha = false; mFont = gui->getFont(); mTextColor = &guiPalette->getColor(Palette::TEXT); mTextBGColor = NULL; @@ -47,6 +48,11 @@ void TextPreview::draw(gcn::Graphics* graphics) if (config.getValue("guialpha", 0.8) != mAlpha) mAlpha = config.getValue("guialpha", 0.8); + int alpha = (int) (mAlpha * 255.0f); + + if (!mTextAlpha) + alpha = 255; + if (mOpaque) { graphics->setColor(gcn::Color((int) mBGColor->r, @@ -69,5 +75,7 @@ void TextPreview::draw(gcn::Graphics* graphics) } TextRenderer::renderText(graphics, *mText, 2, 2, gcn::Graphics::LEFT, - mTextColor, mFont, mOutline, mShadow); + gcn::Color(mTextColor->r, mTextColor->g, + mTextColor->b, alpha), + mFont, mOutline, mShadow, alpha); } -- cgit v1.2.3-70-g09d2