diff options
author | Richard Nelson <none@none> | 2010-07-30 15:17:50 -0700 |
---|---|---|
committer | Richard Nelson <none@none> | 2010-07-30 15:17:50 -0700 |
commit | c60fd88714727a86d5b905c1986bc2ca6013791e (patch) | |
tree | c41da40bbfe02dc2d1441b95e5a0e84cf7dd300b /indra/llui/llview.cpp | |
parent | fbd05e947829714d81278dfa0b138b22e32d56a7 (diff) | |
parent | b95ad3b5cec84387d20d2a1af08eeb090b54b134 (diff) |
merge
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r-- | indra/llui/llview.cpp | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 9e68277b0f..4d3708302b 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -403,28 +403,40 @@ bool LLCompareByTabOrder::operator() (const LLView* const a, const LLView* const return (a_score == b_score) ? a < b : a_score < b_score; } -bool LLView::trueToRoot(const boost::function<bool (const LLView*)>& predicate) const +BOOL LLView::isInVisibleChain() const { - const LLView* cur_view = this; - while(cur_view) + BOOL visible = TRUE; + + const LLView* viewp = this; + while(viewp) { - if(!predicate(cur_view)) + if (!viewp->getVisible()) { - return false; + visible = FALSE; + break; } - cur_view = cur_view->getParent(); + viewp = viewp->getParent(); } - return true; -} - -BOOL LLView::isInVisibleChain() const -{ - return trueToRoot(&LLView::getVisible); + + return visible; } BOOL LLView::isInEnabledChain() const { - return trueToRoot(&LLView::getEnabled); + BOOL enabled = TRUE; + + const LLView* viewp = this; + while(viewp) + { + if (!viewp->getEnabled()) + { + enabled = FALSE; + break; + } + viewp = viewp->getParent(); + } + + return enabled; } // virtual |