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/dropshortcutcontainer.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/dropshortcutcontainer.cpp')
-rw-r--r-- | src/gui/widgets/dropshortcutcontainer.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 92f02c78f..b628cf2d4 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -73,6 +73,8 @@ DropShortcutContainer::DropShortcutContainer(): mBoxHeight = 1; mBoxWidth = 1; } + mEquipedColor = Theme::getThemeColor(Theme::ITEM_EQUIPPED); + mUnEquipedColor = Theme::getThemeColor(Theme::ITEM_NOT_EQUIPPED); } DropShortcutContainer::~DropShortcutContainer() @@ -110,12 +112,6 @@ void DropShortcutContainer::draw(gcn::Graphics *graphics) if (mBackgroundImg) g->drawImage(mBackgroundImg, itemX, itemY); -/* // Draw item keyboard shortcut. - const char *key = SDL_GetKeyName( - (SDLKey) keyboard.getKeyValue(keyboard.KEY_SHORTCUT_1 + i)); - graphics->setColor(guiPalette->getColor(Palette::TEXT)); - g->drawText(key, itemX + 2, itemY + 2, gcn::Graphics::LEFT); -*/ if (dropShortcut->getItem(i) < 0) continue; @@ -142,11 +138,11 @@ void DropShortcutContainer::draw(gcn::Graphics *graphics) image->setAlpha(1.0f); g->drawImage(image, itemX, itemY); if (item->isEquipped()) - g->setColor(Theme::getThemeColor(Theme::ITEM_EQUIPPED)); + g->setColor(mEquipedColor); else - g->setColor(Theme::getThemeColor(Theme::TEXT)); + g->setColor(mUnEquipedColor); g->drawText(caption, itemX + mBoxWidth / 2, - itemY + mBoxHeight - 14, gcn::Graphics::CENTER); + itemY + mBoxHeight - 14, gcn::Graphics::CENTER); } } } |