diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-28 23:00:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-28 23:09:33 +0300 |
commit | 739fd277e28120cd643ac443a013b482698427ba (patch) | |
tree | 3f2a154ce26753f5d2014ea50e440499ab8f9305 /src/gui/widgets | |
parent | 727808b197394912f212641fb2e39088eab82060 (diff) | |
download | plus-739fd277e28120cd643ac443a013b482698427ba.tar.gz plus-739fd277e28120cd643ac443a013b482698427ba.tar.bz2 plus-739fd277e28120cd643ac443a013b482698427ba.tar.xz plus-739fd277e28120cd643ac443a013b482698427ba.zip |
Hide popups in different hidden windows.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/dropshortcutcontainer.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/dropshortcutcontainer.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/emoteshortcutcontainer.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/emoteshortcutcontainer.h | 8 | ||||
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.cpp | 14 | ||||
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/spellshortcutcontainer.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/spellshortcutcontainer.h | 2 |
8 files changed, 49 insertions, 5 deletions
diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index b628cf2d4..1fa272448 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -306,5 +306,12 @@ void DropShortcutContainer::mouseMoved(gcn::MouseEvent &event) // Hide ItemTooltip void DropShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) { - mItemPopup->setVisible(false); + if (mItemPopup) + mItemPopup->setVisible(false); +} + +void DropShortcutContainer::widgetHidden(const gcn::Event &event A_UNUSED) +{ + if (mItemPopup) + mItemPopup->setVisible(false); } diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h index b2d63a7dd..348f48567 100644 --- a/src/gui/widgets/dropshortcutcontainer.h +++ b/src/gui/widgets/dropshortcutcontainer.h @@ -76,6 +76,8 @@ class DropShortcutContainer : public ShortcutContainer */ void mouseReleased(gcn::MouseEvent &event); + void widgetHidden(const gcn::Event &event); + private: void mouseExited(gcn::MouseEvent &event); void mouseMoved(gcn::MouseEvent &event); diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index 5aced193f..cc9e8badf 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -252,4 +252,10 @@ void EmoteShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) { if (mEmotePopup) mEmotePopup->setVisible(false); -}
\ No newline at end of file +} + +void EmoteShortcutContainer::widgetHidden(const gcn::Event &event A_UNUSED) +{ + if (mEmotePopup) + mEmotePopup->setVisible(false); +} diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h index b1cc866d2..06c009f0b 100644 --- a/src/gui/widgets/emoteshortcutcontainer.h +++ b/src/gui/widgets/emoteshortcutcontainer.h @@ -27,6 +27,12 @@ #include <vector> +#ifdef __GNUC__ +#define A_UNUSED __attribute__ ((unused)) +#else +#define A_UNUSED +#endif + class AnimatedSprite; class Image; class TextPopup; @@ -73,6 +79,8 @@ class EmoteShortcutContainer : public ShortcutContainer void mouseExited(gcn::MouseEvent &event); + void widgetHidden(const gcn::Event &event); + private: std::vector<const EmoteSprite*> mEmoteImg; diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 79685fe45..560045a29 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -378,6 +378,16 @@ void ItemShortcutContainer::mouseMoved(gcn::MouseEvent &event) // Hide ItemTooltip void ItemShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) { - mItemPopup->setVisible(false); - mSpellPopup->setVisible(false); + if (mItemPopup) + mItemPopup->setVisible(false); + if (mSpellPopup) + mSpellPopup->setVisible(false); +} + +void ItemShortcutContainer::widgetHidden(const gcn::Event &event A_UNUSED) +{ + if (mItemPopup) + mItemPopup->setVisible(false); + if (mSpellPopup) + mSpellPopup->setVisible(false); } diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index e6b32c6f8..473cef350 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -78,6 +78,8 @@ class ItemShortcutContainer : public ShortcutContainer */ void mouseReleased(gcn::MouseEvent &event); + void widgetHidden(const gcn::Event &event); + private: void mouseExited(gcn::MouseEvent &event); void mouseMoved(gcn::MouseEvent &event); diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 8abe727b5..6317dd56f 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -290,5 +290,12 @@ void SpellShortcutContainer::mouseMoved(gcn::MouseEvent &event) // Hide SpellTooltip void SpellShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) { - mSpellPopup->setVisible(false); + if (mSpellPopup) + mSpellPopup->setVisible(false); +} + +void SpellShortcutContainer::widgetHidden(const gcn::Event &event A_UNUSED) +{ + if (mSpellPopup) + mSpellPopup->setVisible(false); } diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h index 2155e2a8b..88b00338a 100644 --- a/src/gui/widgets/spellshortcutcontainer.h +++ b/src/gui/widgets/spellshortcutcontainer.h @@ -77,6 +77,8 @@ class SpellShortcutContainer : public ShortcutContainer */ void mouseReleased(gcn::MouseEvent &event); + void widgetHidden(const gcn::Event &event); + private: void mouseExited(gcn::MouseEvent &event); void mouseMoved(gcn::MouseEvent &event); |