diff options
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/popup.cpp | 7 | ||||
-rw-r--r-- | src/gui/widgets/popup.h | 6 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 4 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index 391b0eed..970b21ec 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -27,6 +27,7 @@ #include "log.h" #include "gui/skin.h" +#include "gui/viewport.h" #include "gui/widgets/windowcontainer.h" @@ -186,3 +187,9 @@ void Popup::position(int x, int y) setVisible(true); requestMoveToTop(); } + +void Popup::mouseMoved(gcn::MouseEvent &event) +{ + if (viewport) + viewport->hideBeingPopup(); +} diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index 207a9857..5c9164f6 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -28,6 +28,8 @@ #include "gui/widgets/container.h" +#include <guichan/mouselistener.hpp> + class Skin; class WindowContainer; @@ -43,7 +45,7 @@ class WindowContainer; * * \ingroup GUI */ -class Popup : public Container +class Popup : public Container, public gcn::MouseListener { public: /** @@ -94,6 +96,8 @@ class Popup : public Container */ void setLocationRelativeTo(gcn::Widget *widget); + void mouseMoved(gcn::MouseEvent &event); + /** * Sets the minimum width of the popup. */ diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 8505f552..83c918cf 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -27,6 +27,7 @@ #include "gui/gui.h" #include "gui/palette.h" #include "gui/skin.h" +#include "gui/viewport.h" #include "gui/widgets/layout.h" #include "gui/widgets/resizegrip.h" @@ -430,6 +431,9 @@ void Window::mouseMoved(gcn::MouseEvent &event) default: gui->setCursorType(Gui::CURSOR_POINTER); } + + if (viewport) + viewport->hideBeingPopup(); } void Window::mouseDragged(gcn::MouseEvent &event) |