summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-09-28 20:01:47 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-09-28 20:01:47 +0200
commit93c60c2b94b658e4839641c25f56859706cca921 (patch)
treec65fc3bdc094b13a08fe7505f21eff418c188a51 /src
parent4e7d8d60c90ad8f981697e6641e3b9296d28b267 (diff)
parent48fb6a6a345ae091c78a119795f7716102126241 (diff)
downloadmana-client-93c60c2b94b658e4839641c25f56859706cca921.tar.gz
mana-client-93c60c2b94b658e4839641c25f56859706cca921.tar.bz2
mana-client-93c60c2b94b658e4839641c25f56859706cca921.tar.xz
mana-client-93c60c2b94b658e4839641c25f56859706cca921.zip
Merge github.com:mana/mana
Diffstat (limited to 'src')
-rw-r--r--src/gui/inventorywindow.cpp6
-rw-r--r--src/gui/inventorywindow.h5
-rw-r--r--src/gui/widgets/itemcontainer.cpp5
-rw-r--r--src/gui/widgets/itemcontainer.h2
-rw-r--r--src/gui/widgets/window.h2
5 files changed, 19 insertions, 1 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 0dbeb352..2a899fe2 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -237,6 +237,12 @@ Item *InventoryWindow::getSelectedItem() const
return mItems->getSelectedItem();
}
+void InventoryWindow::widgetHidden(const gcn::Event &event)
+{
+ Window::widgetHidden(event);
+ mItems->hidePopup();
+}
+
void InventoryWindow::mouseClicked(gcn::MouseEvent &event)
{
Window::mouseClicked(event);
diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h
index ebd2be22..2a6131a2 100644
--- a/src/gui/inventorywindow.h
+++ b/src/gui/inventorywindow.h
@@ -67,6 +67,11 @@ class InventoryWindow : public Window,
Item* getSelectedItem() const;
/**
+ * Handles closing of the window
+ */
+ virtual void widgetHidden(const gcn::Event &event);
+
+ /**
* Handles the mouse clicks.
*/
void mouseClicked(gcn::MouseEvent &event);
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 2cd0fa23..546a16d2 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -228,6 +228,11 @@ void ItemContainer::distributeValueChangedEvent()
}
}
+void ItemContainer::hidePopup()
+{
+ mItemPopup->setVisible(false);
+}
+
void ItemContainer::keyPressed(gcn::KeyEvent &event)
{
/*switch (event.getKey().getValue())
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h
index ca21ad3f..4d5afde2 100644
--- a/src/gui/widgets/itemcontainer.h
+++ b/src/gui/widgets/itemcontainer.h
@@ -62,6 +62,8 @@ class ItemContainer : public gcn::Widget,
virtual ~ItemContainer();
+ void hidePopup();
+
/**
* Necessary for checking how full the inventory is.
*/
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index e62f4d92..64631287 100644
--- a/src/gui/widgets/window.h
+++ b/src/gui/widgets/window.h
@@ -105,7 +105,7 @@ class Window : public gcn::Window, gcn::WidgetListener
/**
* Called whenever the widget is hidden.
*/
- virtual void widgetHidden(const gcn::Event& event);
+ virtual void widgetHidden(const gcn::Event &event);
/**
* Sets whether or not the window has a close button.