summaryrefslogtreecommitdiff
path: root/src/gui/widgets/button.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-25 02:14:18 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-25 02:20:24 +0300
commita603cf32c1491e1a943d77b76e0f2362babcd7b8 (patch)
tree8841385c90b85b84b9589c633f0f569291d6cb1c /src/gui/widgets/button.cpp
parente3682e2cdcb59c36792f6f9c39569e0af01088f0 (diff)
downloadmanaplus-a603cf32c1491e1a943d77b76e0f2362babcd7b8.tar.gz
manaplus-a603cf32c1491e1a943d77b76e0f2362babcd7b8.tar.bz2
manaplus-a603cf32c1491e1a943d77b76e0f2362babcd7b8.tar.xz
manaplus-a603cf32c1491e1a943d77b76e0f2362babcd7b8.zip
Remove color2 from graphics.
Diffstat (limited to 'src/gui/widgets/button.cpp')
-rw-r--r--src/gui/widgets/button.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index dab8dc2d9..13c93ed1a 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -510,21 +510,6 @@ void Button::draw(Graphics *graphics)
const int padding = skin->getPadding();
const int spacing = mSpacing[mode];
- switch (mode)
- {
- case BUTTON_DISABLED:
- graphics->setColorAll(mDisabledColor, mDisabledColor2);
- break;
- case BUTTON_PRESSED:
- graphics->setColorAll(mPressedColor, mPressedColor2);
- break;
- case BUTTON_HIGHLIGHTED:
- graphics->setColorAll(mHighlightedColor, mHighlightedColor2);
- break;
- default:
- graphics->setColorAll(mEnabledColor, mEnabledColor2);
- break;
- }
if (recalc)
mTextChanged = true;
@@ -636,8 +621,25 @@ void Button::draw(Graphics *graphics)
mTextChunk.textFont = font;
mTextChunk.deleteImage();
mTextChunk.text = mCaption;
- mTextChunk.color = graphics->getColor();
- mTextChunk.color2 = graphics->getColor2();
+ switch (mode)
+ {
+ case BUTTON_DISABLED:
+ mTextChunk.color = mDisabledColor;
+ mTextChunk.color2 = mDisabledColor2;
+ break;
+ case BUTTON_PRESSED:
+ mTextChunk.color = mPressedColor;
+ mTextChunk.color2 = mPressedColor2;
+ break;
+ case BUTTON_HIGHLIGHTED:
+ mTextChunk.color = mHighlightedColor;
+ mTextChunk.color2 = mHighlightedColor2;
+ break;
+ default:
+ mTextChunk.color = mEnabledColor;
+ mTextChunk.color2 = mEnabledColor2;
+ break;
+ }
font->generate(mTextChunk);
mTextChanged = false;
}