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 | |
parent | b6890180eae59529a5825a47f80c9833c0959352 (diff) |
SL-6109 Better menu accelerator support and slight reorganization
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llmenugl.cpp | 21 | ||||
-rw-r--r-- | indra/llui/llmenugl.h | 2 |
2 files changed, 23 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() { diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 3a6b849e73..0653864892 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -792,6 +792,8 @@ public: void resetMenuTrigger() { mAltKeyTrigger = FALSE; } + bool hasAccelerator(const KEY &key, const MASK &mask) const; + private: // add a menu - this will create a drop down menu. virtual BOOL appendMenu( LLMenuGL* menu ); |