summaryrefslogtreecommitdiff
path: root/indra/llui/llmenugl.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2008-05-20 23:24:16 +0000
committerJames Cook <james@lindenlab.com>2008-05-20 23:24:16 +0000
commit2b863df7c8fdede8db5d30349f7778d9f7897e28 (patch)
treef08321bc46b7cd61ee756d33a3d0793a73c6b6ab /indra/llui/llmenugl.cpp
parent38558960978a0741dd9c79c4c7a108b8a1f99eff (diff)
svn merge -r87877:87878 svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-ui/maint-ui-12-qa-5 which is the last iteration of the maint-ui series of branches. Future work will be in featurettes.
Diffstat (limited to 'indra/llui/llmenugl.cpp')
-rw-r--r--indra/llui/llmenugl.cpp37
1 files changed, 34 insertions, 3 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 8ae44fbfd5..bc4445ea6c 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -3879,6 +3879,8 @@ BOOL LLMenuBarGL::handleAcceleratorKey(KEY key, MASK mask)
}
else
{
+ // close menus originating from other menu bars when first opening menu via keyboard
+ LLMenuGL::sMenuContainer->hideMenus();
highlightNextItem(NULL);
LLMenuGL::setKeyboardMode(TRUE);
}
@@ -3921,13 +3923,38 @@ BOOL LLMenuBarGL::handleJumpKey(KEY key)
return TRUE;
}
+BOOL LLMenuBarGL::handleMouseDown(S32 x, S32 y, MASK mask)
+{
+ // clicks on menu bar closes existing menus from other contexts but leave
+ // own menu open so that we get toggle behavior
+ if (!getHighlightedItem() || !getHighlightedItem()->isActive())
+ {
+ LLMenuGL::sMenuContainer->hideMenus();
+ }
+
+ return LLMenuGL::handleMouseDown(x, y, mask);
+}
+
+BOOL LLMenuBarGL::handleRightMouseDown(S32 x, S32 y, MASK mask)
+{
+ // clicks on menu bar closes existing menus from other contexts but leave
+ // own menu open so that we get toggle behavior
+ if (!getHighlightedItem() || !getHighlightedItem()->isActive())
+ {
+ LLMenuGL::sMenuContainer->hideMenus();
+ }
+
+ return LLMenuGL::handleMouseDown(x, y, mask);
+}
+
+
void LLMenuBarGL::draw()
{
LLMenuItemGL* itemp = getHighlightedItem();
// If we are in mouse-control mode and the mouse cursor is not hovering over
- // the current highlighted menu item and it isn't open, then remove the highlight.
- // This is done via a polling mechanism here, as we don't receive notifications when
- // the mouse cursor moves off of us
+ // the current highlighted menu item and it isn't open, then remove the
+ // highlight. This is done via a polling mechanism here, as we don't receive
+ // notifications when the mouse cursor moves off of us
if (itemp && !itemp->isOpen() && !itemp->getHover() && !LLMenuGL::getKeyboardMode())
{
clearHoverItem();
@@ -3954,6 +3981,9 @@ void LLMenuBarGL::checkMenuTrigger()
}
else
{
+ // close menus originating from other menu bars
+ LLMenuGL::sMenuContainer->hideMenus();
+
highlightNextItem(NULL);
LLMenuGL::setKeyboardMode(TRUE);
}
@@ -4362,6 +4392,7 @@ LLTearOffMenu* LLTearOffMenu::create(LLMenuGL* menup)
// keep onscreen
gFloaterView->adjustToFitScreen(tearoffp, FALSE);
tearoffp->open(); /* Flawfinder: ignore */
+
return tearoffp;
}