diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-12-04 09:09:01 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-12-04 09:09:01 -0700 |
commit | 257fa6b93daa151dcaacf1f45f0111d6c4187d37 (patch) | |
tree | dd8f43c2c93f8d15e84e01a0eff090f7ae269a9b /src/gui | |
parent | d88c6a103aed290039a608e1f2d7e04b5a5a503f (diff) | |
download | mana-257fa6b93daa151dcaacf1f45f0111d6c4187d37.tar.gz mana-257fa6b93daa151dcaacf1f45f0111d6c4187d37.tar.bz2 mana-257fa6b93daa151dcaacf1f45f0111d6c4187d37.tar.xz mana-257fa6b93daa151dcaacf1f45f0111d6c4187d37.zip |
Reset the cursor when a window is hidden
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/buy.cpp | 2 | ||||
-rw-r--r-- | src/gui/sell.cpp | 3 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/window.h | 5 |
4 files changed, 15 insertions, 3 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index a2398472..b4f8ca5e 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -268,7 +268,7 @@ void BuyDialog::logic() { Window::logic(); - if (!current_npc) setVisible(false); + if (!current_npc && isVisible()) setVisible(false); } void BuyDialog::setVisible(bool visible) diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index 4082b881..1194222b 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -286,8 +286,7 @@ void SellDialog::logic() { Window::logic(); - if (!current_npc) - setVisible(false); + if (!current_npc && isVisible()) setVisible(false); } void SellDialog::setVisible(bool visible) diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 0ffae6ea..e36aea97 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -279,6 +279,14 @@ void Window::widgetResized(const gcn::Event &event) } } +void Window::widgetHidden(const gcn::Event &event) +{ + if (gui) + { + gui->setCursorType(Gui::CURSOR_POINTER); + } +} + void Window::setCloseButton(bool flag) { mCloseButton = flag; diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index b3ef3fdc..199c295c 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -103,6 +103,11 @@ class Window : public gcn::Window, gcn::WidgetListener void widgetResized(const gcn::Event &event); /** + * Called whenever the widget is hidden. + */ + void widgetHidden(const gcn::Event &event); + + /** * Sets whether or not the window has a close button. */ void setCloseButton(bool flag); |