summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/shoplistbox.cpp11
-rw-r--r--src/gui/widgets/shoplistbox.h13
2 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp
index 2f5fab34..a5033570 100644
--- a/src/gui/widgets/shoplistbox.cpp
+++ b/src/gui/widgets/shoplistbox.cpp
@@ -61,6 +61,11 @@ ShopListBox::ShopListBox(gcn::ListModel *listModel, ShopItems *shopListModel):
mItemPopup = new ItemPopup;
}
+ShopListBox::~ShopListBox()
+{
+ delete mItemPopup;
+}
+
void ShopListBox::setPlayersMoney(int money)
{
mPlayerMoney = money;
@@ -167,3 +172,9 @@ void ShopListBox::mouseMoved(gcn::MouseEvent &event)
}
}
}
+
+void ShopListBox::mouseExited(gcn::MouseEvent &event)
+{
+ mItemPopup->setVisible(false);
+}
+
diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h
index 062ad93a..9232a5a4 100644
--- a/src/gui/widgets/shoplistbox.h
+++ b/src/gui/widgets/shoplistbox.h
@@ -48,6 +48,11 @@ class ShopListBox : public ListBox
ShopListBox(gcn::ListModel *listModel, ShopItems *shopListModel);
/**
+ * Deconstructor
+ */
+ ~ShopListBox();
+
+ /**
* Draws the list box.
*/
void draw(gcn::Graphics *graphics);
@@ -73,8 +78,16 @@ class ShopListBox : public ListBox
*/
void setPriceCheck(bool check);
+ /**
+ ** Show ItemTooltip
+ */
void mouseMoved(gcn::MouseEvent &event);
+ /**
+ ** Hide ItemTooltip
+ */
+ void mouseExited(gcn::MouseEvent &event);
+
private:
int mPlayerMoney;