summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-08-08 15:13:53 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-08-08 15:13:53 -0700
commitb6685b5872a4afe976f39d201868b8d656044e84 (patch)
tree91b138a276cc51078f57ce4f0b059a63fa2230c2 /indra/llui
parentd712dde69e29381ab1bf55f27c41bb3b29ef3b59 (diff)
EXP-1065 FIX -- Inventory has slowed to a crawl. Clicking between items has an average one second delay. Same with switching between tabs.
* Removed numerous places in the code that called findChild across the inventory panel unnecessarily. * Conglomerated uses of inbox and outbox inventory panels to the sidepanel class so the pointers can be cached and functionality like selection handling can be done more efficiently. * Optimized LLView::childHasKeyboardFocus() to work backwards up from the focus object rather than searching for children that may or may not turn out to have focus. Reviewed by Richard.
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llview.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 8803d106ba..659a54cc6e 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1655,15 +1655,19 @@ BOOL LLView::hasAncestor(const LLView* parentp) const
BOOL LLView::childHasKeyboardFocus( const std::string& childname ) const
{
- LLView *child = findChildView(childname, TRUE);
- if (child)
- {
- return gFocusMgr.childHasKeyboardFocus(child);
- }
- else
+ LLView *focus = dynamic_cast<LLView *>(gFocusMgr.getKeyboardFocus());
+
+ while (focus != NULL)
{
- return FALSE;
+ if (focus->getName() == childname)
+ {
+ return TRUE;
+ }
+
+ focus = focus->getParent();
}
+
+ return FALSE;
}
//-----------------------------------------------------------------------------