diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-23 21:59:21 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-23 22:00:09 +0100 |
commit | 99e8a3fd77b63a029fe02dcf771b6af1aad252ed (patch) | |
tree | 03c296d1f89859aae35336dfe2f58df09d256fd3 /src/gui/itemshortcutcontainer.cpp | |
parent | fa8a4bf49100c0a1d5b96e00803f43bbbb861100 (diff) | |
parent | 347452b9b69ef3af29c577b7751082822e900c01 (diff) | |
download | mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.gz mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.bz2 mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.xz mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.zip |
Merge branch 'aethyra/master'
Conflicts:
Many files.
Diffstat (limited to 'src/gui/itemshortcutcontainer.cpp')
-rw-r--r-- | src/gui/itemshortcutcontainer.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp index 67525140..9f77fd65 100644 --- a/src/gui/itemshortcutcontainer.cpp +++ b/src/gui/itemshortcutcontainer.cpp @@ -22,6 +22,7 @@ #include "inventorywindow.h" #include "itemshortcutcontainer.h" #include "itempopup.h" +#include "palette.h" #include "viewport.h" #include "../configuration.h" @@ -46,6 +47,7 @@ ItemShortcutContainer::ItemShortcutContainer(): addWidgetListener(this); mItemPopup = new ItemPopup; + mItemPopup->setOpaque(false); ResourceManager *resman = ResourceManager::getInstance(); @@ -64,22 +66,6 @@ ItemShortcutContainer::~ItemShortcutContainer() delete mItemPopup; } -void ItemShortcutContainer::logic() -{ - if (!isVisible()) - return; - - gcn::Widget::logic(); - - int i = itemShortcut->getItemCount(); - - if (i != mMaxItems) - { - mMaxItems = i; - setWidth(getWidth()); - } -} - void ItemShortcutContainer::draw(gcn::Graphics *graphics) { if (!isVisible()) @@ -93,7 +79,6 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) Graphics *g = static_cast<Graphics*>(graphics); - graphics->setColor(gcn::Color(0, 0, 0)); graphics->setFont(getFont()); for (int i = 0; i < mMaxItems; i++) @@ -106,7 +91,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) // Draw item keyboard shortcut. const char *key = SDL_GetKeyName( (SDLKey) keyboard.getKeyValue(keyboard.KEY_SHORTCUT_1 + i)); - graphics->setColor(0x000000); + graphics->setColor(guiPalette->getColor(Palette::TEXT)); g->drawText(key, itemX + 2, itemY + 2, gcn::Graphics::LEFT); if (itemShortcut->getItem(i) < 0) @@ -249,8 +234,9 @@ void ItemShortcutContainer::mouseMoved(gcn::MouseEvent &event) if (item && inventoryWindow->isVisible()) { - mItemPopup->setItem(item->getInfo()); - mItemPopup->setOpaque(false); + if (item->getInfo().getName() != mItemPopup->getItemName()) + mItemPopup->setItem(item->getInfo()); + mItemPopup->updateColors(); mItemPopup->view(viewport->getMouseX(), viewport->getMouseY()); } else |