summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-04-29 20:29:56 +0300
committerandreykproductengine <akleshchev@productengine.com>2015-04-29 20:29:56 +0300
commit9b0763516352f60e8532d0fa177b76fd96ffd582 (patch)
tree0ac923d2f90fe69b75eb49ca3dbdc6aa48544010 /indra/llui
parentd05107193b03fc4b035975bae99710d0167ce0ad (diff)
MAINT-839 FIXED [PUBLIC]Clicking a menu a second time does not close it.
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llmenugl.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 7cdbcb0621..43ceb0e4c6 100755
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1043,7 +1043,7 @@ void LLMenuItemBranchGL::onCommit( void )
// keyboard navigation automatically propagates highlight to sub-menu
// to facilitate fast menu control via jump keys
- if (LLMenuGL::getKeyboardMode() && getBranch()&& !getBranch()->getHighlightedItem())
+ if (LLMenuGL::getKeyboardMode() && getBranch() && !getBranch()->getHighlightedItem())
{
getBranch()->highlightNextItem(NULL);
}
@@ -1456,7 +1456,24 @@ BOOL LLMenuItemBranchDownGL::handleMouseDown( S32 x, S32 y, MASK mask )
{
// switch to mouse control mode
LLMenuGL::setKeyboardMode(FALSE);
- onCommit();
+
+ if (getVisible() && getHighlight() && getBranch())
+ {
+ // already open - hide menu
+ LLMenuGL::setKeyboardMode(FALSE);
+ for (child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
+ {
+ LLView* viewp = *child_it;
+ if (dynamic_cast<LLMenuGL*>(viewp) != NULL && viewp->getVisible())
+ {
+ viewp->setVisible(FALSE);
+ }
+ }
+ }
+ else
+ {
+ onCommit();
+ }
make_ui_sound("UISndClick");
return TRUE;
}