summaryrefslogtreecommitdiff
path: root/indra/llui/llbadgeowner.cpp
diff options
context:
space:
mode:
authorDebi King (Dessie) <dessie@lindenlab.com>2011-08-28 10:43:02 -0400
committerDebi King (Dessie) <dessie@lindenlab.com>2011-08-28 10:43:02 -0400
commit3d2378f1020060a84ab0b9ae23507077b7a0e7c1 (patch)
tree448bc57cf16514ef602602feff45ec4583d18608 /indra/llui/llbadgeowner.cpp
parentf094d4f7529c27233f5ca228bda21deb9b864f1a (diff)
parentebb55355ebbe6ec6760d8683e461903957ed24e5 (diff)
merge from viewer-pre-release
Diffstat (limited to 'indra/llui/llbadgeowner.cpp')
-rw-r--r--indra/llui/llbadgeowner.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp
index 77f15567bf..1860a05edd 100644
--- a/indra/llui/llbadgeowner.cpp
+++ b/indra/llui/llbadgeowner.cpp
@@ -26,6 +26,7 @@
#include "linden_common.h"
+#include "llbadgeholder.h"
#include "llbadgeowner.h"
#include "llpanel.h"
@@ -81,40 +82,44 @@ void LLBadgeOwner::setBadgeVisibility(bool visible)
}
}
-void LLBadgeOwner::addBadgeToParentPanel()
+bool LLBadgeOwner::addBadgeToParentPanel()
{
+ bool badge_added = false;
+
LLView * owner_view = mBadgeOwnerView.get();
if (mBadge && owner_view)
{
- // Badge parent is badge owner by default
- LLView * badge_parent = owner_view;
+ LLBadgeHolder * badge_holder = NULL;
- // Find the appropriate parent for the badge
+ // Find the appropriate holder for the badge
LLView * parent = owner_view->getParent();
while (parent)
{
- LLPanel * parent_panel = dynamic_cast<LLPanel *>(parent);
+ LLBadgeHolder * badge_holder_panel = dynamic_cast<LLBadgeHolder *>(parent);
- if (parent_panel && parent_panel->acceptsBadge())
+ if (badge_holder_panel && badge_holder_panel->acceptsBadge())
{
- badge_parent = parent;
+ badge_holder = badge_holder_panel;
break;
}
parent = parent->getParent();
}
- if (badge_parent)
+ if (badge_holder)
{
- badge_parent->addChild(mBadge);
+ badge_added = badge_holder->addBadge(mBadge);
}
else
{
- llwarns << "Unable to find parent panel for badge " << mBadge->getName() << " on " << owner_view->getName() << llendl;
+ // Badge parent is fallback badge owner if no valid holder exists in the hierarchy
+ badge_added = mBadge->addToView(owner_view);
}
}
+
+ return badge_added;
}
LLBadge* LLBadgeOwner::createBadge(const LLBadge::Params& p)