diff options
Diffstat (limited to 'src/gui/widgets/button.cpp')
-rw-r--r-- | src/gui/widgets/button.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index 41fbc1093..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++; } @@ -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; |