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 | |
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')
-rw-r--r-- | src/gui/widgets/itemlinkhandler.cpp | 15 | ||||
-rw-r--r-- | src/gui/widgets/itemlinkhandler.h | 3 |
2 files changed, 6 insertions, 12 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()); } } diff --git a/src/gui/widgets/itemlinkhandler.h b/src/gui/widgets/itemlinkhandler.h index 39e811721..c07ede9ad 100644 --- a/src/gui/widgets/itemlinkhandler.h +++ b/src/gui/widgets/itemlinkhandler.h @@ -40,9 +40,6 @@ class ItemLinkHandler final : public LinkHandler void handleLink(const std::string &link, MouseEvent *event) override final; - - private: - ItemPopup *mItemPopup; }; #endif // GUI_WIDGETS_ITEMLINKHANDLER_H |