diff options
| author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-03 19:46:12 +0300 |
|---|---|---|
| committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-03 19:46:12 +0300 |
| commit | b8c5ae8d8fcf9219112c4ab48233615732737e44 (patch) | |
| tree | db0661d9084100f1e700d868ffe78609ccc0f3f0 /indra/llui/llmenugl.cpp | |
| parent | b6890180eae59529a5825a47f80c9833c0959352 (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 e6a3de281e..986f3362b7 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3514,6 +3514,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() { |
