summaryrefslogtreecommitdiff
path: root/src/gui/widgets/button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/button.cpp')
-rw-r--r--src/gui/widgets/button.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 2d9678a53..7c46ae9df 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -135,6 +135,9 @@ void Button::init()
}
updateAlpha();
}
+ mEnabledColor = Theme::getThemeColor(Theme::BUTTON);
+ mDisabledColor = Theme::getThemeColor(Theme::BUTTON_DISABLED);
+
mInstances++;
}
@@ -202,7 +205,7 @@ void Button::draw(gcn::Graphics *graphics)
}
else
{
- // because we dont know where parent windows was moved,
+ // because we don't know where parent windows was moved,
// need recalc vertexes
gcn::ClipRectangle &rect = static_cast<Graphics*>(
graphics)->getTopClip();
@@ -238,9 +241,9 @@ void Button::draw(gcn::Graphics *graphics)
// drawImageRect(0, 0, getWidth(), getHeight(), button[mode]);
if (mode == BUTTON_DISABLED)
- graphics->setColor(Theme::getThemeColor(Theme::BUTTON_DISABLED));
+ graphics->setColor(mDisabledColor);
else
- graphics->setColor(Theme::getThemeColor(Theme::BUTTON));
+ graphics->setColor(mEnabledColor);
int textX;
int textY = getHeight() / 2 - getFont()->getHeight() / 2;