summaryrefslogtreecommitdiff
path: root/indra/llui/llview.cpp
diff options
context:
space:
mode:
authorRichard Nelson <none@none>2010-07-30 15:17:50 -0700
committerRichard Nelson <none@none>2010-07-30 15:17:50 -0700
commit170c7b56a8a4f2520109eecda78229e648ccc49c (patch)
treec41da40bbfe02dc2d1441b95e5a0e84cf7dd300b /indra/llui/llview.cpp
parent84a9e0abd86ea4546e61f9e58cd9c2d67f7def5e (diff)
parentd72a21aca1b9692941c066b7aaca69952c27de68 (diff)
merge
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r--indra/llui/llview.cpp38
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