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/itemcontainer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/gui/widgets/itemcontainer.cpp') diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index c28e4fb4c..91b674018 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -118,6 +118,9 @@ ItemContainer::ItemContainer(Inventory *inventory, bool forceQuantity): if (!mSelImg) logger->log1("Error: Unable to load selection.png"); + mEquipedColor = Theme::getThemeColor(Theme::ITEM_EQUIPPED); + mUnEquipedColor = Theme::getThemeColor(Theme::ITEM_NOT_EQUIPPED); + addKeyListener(this); addMouseListener(this); addWidgetListener(this); @@ -204,9 +207,9 @@ void ItemContainer::draw(gcn::Graphics *graphics) caption = "Eq."; if (item->isEquipped()) - g->setColor(Theme::getThemeColor(Theme::ITEM_EQUIPPED)); + g->setColor(mEquipedColor); else - g->setColor(Theme::getThemeColor(Theme::ITEM_NOT_EQUIPPED)); + g->setColor(mUnEquipedColor); g->drawText(caption, itemX + BOX_WIDTH / 2, itemY + BOX_HEIGHT - 14, gcn::Graphics::CENTER); -- cgit v1.2.3-70-g09d2