From 13a25be08f0c81a759076907d7950baf4f2c3ef2 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 3 Oct 2019 19:46:12 +0300 Subject: SL-6109 Better menu accelerator support and slight reorganization --- indra/llui/llmenugl.cpp | 21 +++++++++++++++++++++ indra/llui/llmenugl.h | 2 ++ 2 files changed, 23 insertions(+) (limited to 'indra/llui') 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::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 b47b6a5214..adcb2ca2f9 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -795,6 +795,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 ); -- cgit v1.2.3