summaryrefslogtreecommitdiff
path: root/src/gui/windows/equipmentwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-17 15:49:46 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-17 15:49:46 +0300
commit28072bc9da91582e5a0caec64fba880f51e5d639 (patch)
treea31932db9200562ea881f11f11f4d70a08bdf9e9 /src/gui/windows/equipmentwindow.cpp
parentdf05f66206b2e1f0af1444f91d0885f331af22a6 (diff)
downloadmv-28072bc9da91582e5a0caec64fba880f51e5d639.tar.gz
mv-28072bc9da91582e5a0caec64fba880f51e5d639.tar.bz2
mv-28072bc9da91582e5a0caec64fba880f51e5d639.tar.xz
mv-28072bc9da91582e5a0caec64fba880f51e5d639.zip
Use public item popup in equipmentwindow.
Diffstat (limited to 'src/gui/windows/equipmentwindow.cpp')
-rw-r--r--src/gui/windows/equipmentwindow.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index 5600de741..a3f3d103f 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -63,7 +63,6 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment,
Window(_("Equipment"), false, nullptr, "equipment.xml"),
ActionListener(),
mEquipment(equipment),
- mItemPopup(new ItemPopup),
mPlayerBox(new PlayerBox(this,
"equipment_playerbox.xml",
"equipment_selectedplayerbox.xml")),
@@ -89,7 +88,6 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment,
mMaxY(0),
mForing(foring)
{
- mItemPopup->postInit();
if (setupWindow)
setupWindow->registerWindowForReset(this);
@@ -137,7 +135,6 @@ void EquipmentWindow::postInit()
EquipmentWindow::~EquipmentWindow()
{
- delete2(mItemPopup);
if (this == beingEquipmentWindow)
{
if (mEquipment)
@@ -349,8 +346,8 @@ void EquipmentWindow::mousePressed(MouseEvent& event)
{
if (Item *const item = getItem(x, y))
{
- if (mItemPopup)
- mItemPopup->setVisible(false);
+ if (itemPopup)
+ itemPopup->setVisible(false);
/* Convert relative to the window coordinates to absolute screen
* coordinates.
@@ -430,7 +427,7 @@ void EquipmentWindow::mouseMoved(MouseEvent &event)
{
Window::mouseMoved(event);
- if (!mItemPopup)
+ if (!itemPopup)
return;
const int x = event.getX();
@@ -440,20 +437,20 @@ void EquipmentWindow::mouseMoved(MouseEvent &event)
if (item)
{
- mItemPopup->setItem(item);
- mItemPopup->position(x + getX(), y + getY());
+ itemPopup->setItem(item);
+ itemPopup->position(x + getX(), y + getY());
}
else
{
- mItemPopup->setVisible(false);
+ itemPopup->setVisible(false);
}
}
// Hide ItemTooltip
void EquipmentWindow::mouseExited(MouseEvent &event A_UNUSED)
{
- if (mItemPopup)
- mItemPopup->setVisible(false);
+ if (itemPopup)
+ itemPopup->setVisible(false);
}
void EquipmentWindow::setSelected(const int index)
@@ -462,8 +459,8 @@ void EquipmentWindow::setSelected(const int index)
mRedraw = true;
if (mUnequip)
mUnequip->setEnabled(mSelected != -1);
- if (mItemPopup)
- mItemPopup->setVisible(false);
+ if (itemPopup)
+ itemPopup->setVisible(false);
}
void EquipmentWindow::setBeing(Being *const being)