diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-17 15:19:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-17 15:19:33 +0300 |
commit | 8abff8551a2c35c9e19c90eb4304db6195cf3575 (patch) | |
tree | a9c713ba400a081a19000823ed60cebfca337727 /src/gui/widgets/itemlinkhandler.cpp | |
parent | e10d8e83762aa4d1662e8c40d3ef7bbbf9d6a158 (diff) | |
download | manaverse-8abff8551a2c35c9e19c90eb4304db6195cf3575.tar.gz manaverse-8abff8551a2c35c9e19c90eb4304db6195cf3575.tar.bz2 manaverse-8abff8551a2c35c9e19c90eb4304db6195cf3575.tar.xz manaverse-8abff8551a2c35c9e19c90eb4304db6195cf3575.zip |
Use public item popup in itemlinkhandler.
Diffstat (limited to 'src/gui/widgets/itemlinkhandler.cpp')
-rw-r--r-- | src/gui/widgets/itemlinkhandler.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index f63991f8d..433639944 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -49,15 +49,12 @@ namespace } // namespace ItemLinkHandler::ItemLinkHandler() : - LinkHandler(), - mItemPopup(new ItemPopup) + LinkHandler() { - mItemPopup->postInit(); } ItemLinkHandler::~ItemLinkHandler() { - delete2(mItemPopup); } void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *event) @@ -106,7 +103,7 @@ void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *event) } else { - if (!mItemPopup || link.empty()) + if (!itemPopup || link.empty()) return; const char ch = link[0]; @@ -124,14 +121,14 @@ void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *event) if (id > 0) { const ItemInfo &itemInfo = ItemDB::get(id); - mItemPopup->setItem(itemInfo, color, true); - if (mItemPopup->isPopupVisible()) + itemPopup->setItem(itemInfo, color, true); + if (itemPopup->isPopupVisible()) { - mItemPopup->setVisible(false); + itemPopup->setVisible(false); } else if (viewport) { - mItemPopup->position(viewport->getMouseX(), + itemPopup->position(viewport->getMouseX(), viewport->getMouseY()); } } |