summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2009-10-06 22:55:01 +0000
committerLeyla Farazha <leyla@lindenlab.com>2009-10-06 22:55:01 +0000
commit8086923d663cbca32a9b147973f912adcbd4a08a (patch)
tree0cade1f4bb490df1512cbaad82e6ce90138a7ea7 /indra/llui
parent5c51eb5a345f0e5f95d1cab1bfc214022ebf517e (diff)
EXT-1283 [Inspectors] Avatar gear menu does not dismiss when selecting another AV
reviewed by James
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llmenubutton.cpp6
-rw-r--r--indra/llui/llmenubutton.h1
-rw-r--r--indra/llui/lltooltip.cpp12
3 files changed, 18 insertions, 1 deletions
diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp
index 2bb6749c83..8dbcd6e229 100644
--- a/indra/llui/llmenubutton.cpp
+++ b/indra/llui/llmenubutton.cpp
@@ -83,6 +83,12 @@ void LLMenuButton::toggleMenu()
}
+void LLMenuButton::hideMenu()
+{
+ mMenu->setVisible(FALSE);
+}
+
+
BOOL LLMenuButton::handleKeyHere(KEY key, MASK mask )
{
if( KEY_RETURN == key && mask == MASK_NONE && !gKeyboard->getKeyRepeated(key))
diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h
index 94b0e4355d..02eb9d3806 100644
--- a/indra/llui/llmenubutton.h
+++ b/indra/llui/llmenubutton.h
@@ -54,6 +54,7 @@ public:
/*virtual*/ void draw();
/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask );
+ void hideMenu();
protected:
friend class LLUICtrlFactory;
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index d742281f30..c55273cacf 100644
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -38,6 +38,7 @@
// Library includes
#include "lltextbox.h"
#include "lliconctrl.h"
+#include "llmenugl.h" // hideMenus()
#include "llui.h" // positionViewNearMouse()
#include "llwindow.h"
@@ -94,7 +95,16 @@ BOOL LLToolTipView::handleHover(S32 x, S32 y, MASK mask)
BOOL LLToolTipView::handleMouseDown(S32 x, S32 y, MASK mask)
{
LLToolTipMgr::instance().blockToolTips();
- return LLView::handleMouseDown(x, y, mask);
+
+ if (LLView::handleMouseDown(x, y, mask))
+ {
+ // If we are handling the mouse event menu holder
+ // won't get a chance to close menus so do this here
+ LLMenuGL::sMenuContainer->hideMenus();
+ return TRUE;
+ }
+
+ return FALSE;
}
BOOL LLToolTipView::handleMiddleMouseDown(S32 x, S32 y, MASK mask)