diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-03 19:46:12 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-06-23 14:50:02 +0300 |
commit | 13a25be08f0c81a759076907d7950baf4f2c3ef2 (patch) | |
tree | 34e9b80bd35c2594a07df9a877a16804b1dd3551 /indra/llui/llmenugl.cpp | |
parent | 2e656ed358af28f56c8b900345956d431f8c7b4d (diff) |
SL-6109 Better menu accelerator support and slight reorganization
Diffstat (limited to 'indra/llui/llmenugl.cpp')
-rw-r--r-- | indra/llui/llmenugl.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index c266bec777..d97bf2d674 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3536,6 +3536,27 @@ S32 LLMenuBarGL::getRightmostMenuEdge() return (*item_iter)->getRect().mRight; } +bool LLMenuBarGL::hasAccelerator(const KEY &key, const MASK &mask) const +{ + if (key == KEY_NONE) + { + return false; + } + + LLMenuKeyboardBinding *accelerator = NULL; + std::list<LLMenuKeyboardBinding*>::const_iterator list_it; + for (list_it = mAccelerators.begin(); list_it != mAccelerators.end(); ++list_it) + { + accelerator = *list_it; + if ((accelerator->mKey == key) && (accelerator->mMask == (mask & MASK_NORMALKEYS))) + { + return true; + } + } + + return false; +} + // add a vertical separator to this menu BOOL LLMenuBarGL::addSeparator() { |