diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-09-28 11:44:14 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-09-28 11:44:14 +0100 |
commit | 8863805d5ca446f06e73e2ba2b9e9dd35051b8fb (patch) | |
tree | ae8d2d536aa413e556e66bdbe85f2fbf67e5735c /indra/llui | |
parent | 5c9d878d8c2da0d413aa6b0976faa595382681c2 (diff) | |
parent | 53bfc13ab8732633d8a53c2d3602aff3e3e652d2 (diff) |
merge
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llfocusmgr.cpp | 14 | ||||
-rw-r--r-- | indra/llui/llfocusmgr.h | 2 | ||||
-rw-r--r-- | indra/llui/llview.h | 5 |
3 files changed, 21 insertions, 0 deletions
diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 1f16d12add..43e5f6b051 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -315,6 +315,20 @@ void LLFocusMgr::removeKeyboardFocusWithoutCallback( const LLFocusableElement* f } } +bool LLFocusMgr::keyboardFocusHasAccelerators() const +{ + LLView* focus_view = dynamic_cast<LLView*>(mKeyboardFocus); + while( focus_view ) + { + if(focus_view->hasAccelerators()) + { + return true; + } + + focus_view = focus_view->getParent(); + } + return false; +} void LLFocusMgr::setMouseCapture( LLMouseHandler* new_captor ) { diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h index eef82a3b5a..22c1895075 100644 --- a/indra/llui/llfocusmgr.h +++ b/indra/llui/llfocusmgr.h @@ -118,6 +118,8 @@ public: void unlockFocus(); BOOL focusLocked() const { return mLockedView != NULL; } + bool keyboardFocusHasAccelerators() const; + private: LLUICtrl* mLockedView; diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 6bcee98f26..33d345beff 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -273,6 +273,11 @@ public: BOOL focusNextRoot(); BOOL focusPrevRoot(); + // Normally we want the app menus to get priority on accelerated keys + // However, sometimes we want to give specific views a first chance + // iat handling them. (eg. the script editor) + virtual bool hasAccelerators() const { return false; }; + // delete all children. Override this function if you need to // perform any extra clean up such as cached pointers to selected // children, etc. |