From 2d17967845119a77aec6388bb27c47339052704a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 22 Aug 2011 21:16:34 +0300 Subject: Improve draw perfomance. Add new theme color DROPDOWN_SHADOW. --- src/gui/widgets/button.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/gui/widgets/button.cpp') 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; -- cgit v1.2.3-60-g2f50