diff options
author | James Cook <james@lindenlab.com> | 2008-05-20 23:24:16 +0000 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2008-05-20 23:24:16 +0000 |
commit | 2b863df7c8fdede8db5d30349f7778d9f7897e28 (patch) | |
tree | f08321bc46b7cd61ee756d33a3d0793a73c6b6ab /indra/llui | |
parent | 38558960978a0741dd9c79c4c7a108b8a1f99eff (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')
-rw-r--r-- | indra/llui/llmenugl.cpp | 37 | ||||
-rw-r--r-- | indra/llui/llmenugl.h | 4 |
2 files changed, 37 insertions, 4 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; } diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 77998be880..16ab61c607 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -499,7 +499,7 @@ public: void setDropShadowed( const BOOL shadowed ); void setParentMenuItem( LLMenuItemGL* parent_menu_item ) { mParentMenuItem = parent_menu_item; } - LLMenuItemGL* getParentMenuItem() { return mParentMenuItem; } + LLMenuItemGL* getParentMenuItem() const { return mParentMenuItem; } void setTornOff(BOOL torn_off); BOOL getTornOff() { return mTornOff; } @@ -690,6 +690,8 @@ public: virtual BOOL handleAcceleratorKey(KEY key, MASK mask); virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL handleJumpKey(KEY key); + virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); // rearrange the child rects so they fit the shape of the menu // bar. |