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/skilldialog.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/gui/skilldialog.cpp') diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 896f06cab..ff57195a9 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -152,7 +152,9 @@ public: SkillListBox(SkillModel *model): ListBox(model), mModel(model), - mPopup(new TextPopup()) + mPopup(new TextPopup()), + mHighlightColor(Theme::getThemeColor(Theme::HIGHLIGHT)), + mTextColor(Theme::getThemeColor(Theme::TEXT)) { } @@ -187,8 +189,8 @@ public: Graphics *graphics = static_cast(gcnGraphics); - graphics->setColor(Theme::getThemeColor(Theme::HIGHLIGHT, - static_cast(mAlpha * 255.0f))); + mHighlightColor.a = static_cast(mAlpha * 255.0f); + graphics->setColor(mHighlightColor); graphics->setFont(getFont()); // Draw filled rectangle around the selected list element @@ -199,7 +201,7 @@ public: } // Draw the list elements - graphics->setColor(Theme::getThemeColor(Theme::TEXT)); + graphics->setColor(mTextColor); for (int i = 0, y = 1; i < model->getNumberOfElements(); ++i, y += getRowHeight()) @@ -239,6 +241,8 @@ public: private: SkillModel *mModel; TextPopup *mPopup; + gcn::Color mHighlightColor; + gcn::Color mTextColor; }; class SkillTab : public Tab -- cgit v1.2.3-70-g09d2