diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-08-22 21:16:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-08-22 21:16:34 +0300 |
commit | 2d17967845119a77aec6388bb27c47339052704a (patch) | |
tree | 965b636cf677ddf93a30e8606405594a79b7f105 /src/gui/widgets/button.cpp | |
parent | 7bedfccf5982534a9cbcb2c18ca0d37df117bfc8 (diff) | |
download | manaverse-2d17967845119a77aec6388bb27c47339052704a.tar.gz manaverse-2d17967845119a77aec6388bb27c47339052704a.tar.bz2 manaverse-2d17967845119a77aec6388bb27c47339052704a.tar.xz manaverse-2d17967845119a77aec6388bb27c47339052704a.zip |
Improve draw perfomance.
Add new theme color DROPDOWN_SHADOW.
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; |