diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-17 15:46:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-17 15:46:11 +0300 |
commit | df05f66206b2e1f0af1444f91d0885f331af22a6 (patch) | |
tree | b303154e7010e686f0f3a61bba5a8e69203a2604 | |
parent | 0e13c0b844c2a6a4e80965837cbcefd3b02c444f (diff) | |
download | plus-df05f66206b2e1f0af1444f91d0885f331af22a6.tar.gz plus-df05f66206b2e1f0af1444f91d0885f331af22a6.tar.bz2 plus-df05f66206b2e1f0af1444f91d0885f331af22a6.tar.xz plus-df05f66206b2e1f0af1444f91d0885f331af22a6.zip |
Use public item popup in itemamountwindow.
-rw-r--r-- | src/gui/windows/itemamountwindow.cpp | 14 | ||||
-rw-r--r-- | src/gui/windows/itemamountwindow.h | 1 |
2 files changed, 5 insertions, 10 deletions
diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index 4d49eedd9..5f0f063e1 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -102,7 +102,6 @@ ItemAmountWindow::ItemAmountWindow(const Usage usage, Window *const parent, mGPLabel(nullptr), mItem(item), mItemIcon(new Icon(this, item ? item->getImage() : nullptr)), - mItemPopup(new ItemPopup), mItemAmountSlide(new Slider(this, 1.0, maxRange, 1.0)), mItemPriceSlide(nullptr), mItemDropDown(nullptr), @@ -112,8 +111,6 @@ ItemAmountWindow::ItemAmountWindow(const Usage usage, Window *const parent, mUsage(usage), mEnabledKeyboard(keyboard.isEnabled()) { - mItemPopup->postInit(); - if (!mItem) return; @@ -265,7 +262,6 @@ void ItemAmountWindow::postInit() ItemAmountWindow::~ItemAmountWindow() { - delete2(mItemPopup); } // Show ItemTooltip @@ -273,21 +269,21 @@ void ItemAmountWindow::mouseMoved(MouseEvent &event) { Window::mouseMoved(event); - if (!viewport || !mItemPopup) + if (!viewport || !itemPopup) return; if (event.getSource() == mItemIcon) { - mItemPopup->setItem(mItem); - mItemPopup->position(viewport->getMouseX(), viewport->getMouseY()); + itemPopup->setItem(mItem); + itemPopup->position(viewport->getMouseX(), viewport->getMouseY()); } } // Hide ItemTooltip void ItemAmountWindow::mouseExited(MouseEvent &event A_UNUSED) { - if (mItemPopup) - mItemPopup->setVisible(false); + if (itemPopup) + itemPopup->setVisible(false); } void ItemAmountWindow::resetAmount() diff --git a/src/gui/windows/itemamountwindow.h b/src/gui/windows/itemamountwindow.h index ec36265af..04d08613d 100644 --- a/src/gui/windows/itemamountwindow.h +++ b/src/gui/windows/itemamountwindow.h @@ -108,7 +108,6 @@ class ItemAmountWindow final : public Window, Label *mGPLabel; Item *mItem; Icon *mItemIcon; - ItemPopup *mItemPopup; /** * Item Amount buttons. |