summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llbadge.cpp10
-rw-r--r--indra/llui/llbadge.h3
-rw-r--r--indra/llui/llbadgeowner.cpp8
-rw-r--r--indra/llui/llbadgeowner.h1
4 files changed, 21 insertions, 1 deletions
diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp
index 15b6899d74..589b75ab5b 100644
--- a/indra/llui/llbadge.cpp
+++ b/indra/llui/llbadge.cpp
@@ -102,6 +102,7 @@ LLBadge::LLBadge(const LLBadge::Params& p)
, mPaddingHoriz(p.padding_horiz)
, mPaddingVert(p.padding_vert)
, mParentScroller(NULL)
+ , mDrawAtParentTop(false)
{
if (mImage.isNull())
{
@@ -307,7 +308,14 @@ void LLBadge::draw()
// Compute y position
if (mLocationOffsetVCenter == BADGE_OFFSET_NOT_SPECIFIED)
{
- badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter;
+ if(mDrawAtParentTop)
+ {
+ badge_center_y = owner_rect.mTop - badge_height * 0.5f - 1;
+ }
+ else
+ {
+ badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter;
+ }
}
else
{
diff --git a/indra/llui/llbadge.h b/indra/llui/llbadge.h
index 4b21a71aaa..55f92e6e34 100644
--- a/indra/llui/llbadge.h
+++ b/indra/llui/llbadge.h
@@ -137,6 +137,8 @@ public:
const std::string getLabel() const { return wstring_to_utf8str(mLabel); }
void setLabel( const LLStringExplicit& label);
+ void setDrawAtParentTop(bool draw_at_top) { mDrawAtParentTop = draw_at_top;}
+
private:
LLPointer< LLUIImage > mBorderImage;
LLUIColor mBorderColor;
@@ -164,6 +166,7 @@ private:
F32 mPaddingVert;
LLScrollContainer* mParentScroller;
+ bool mDrawAtParentTop;
};
// Build time optimization, generate once in .cpp file
diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp
index 55e64bb940..0557cd4375 100644
--- a/indra/llui/llbadgeowner.cpp
+++ b/indra/llui/llbadgeowner.cpp
@@ -64,6 +64,14 @@ void LLBadgeOwner::setBadgeVisibility(bool visible)
}
}
+void LLBadgeOwner::setDrawBadgeAtTop(bool draw_at_top)
+{
+ if (mBadge)
+ {
+ mBadge->setDrawAtParentTop(draw_at_top);
+ }
+}
+
void LLBadgeOwner::addBadgeToParentHolder()
{
LLView * owner_view = mBadgeOwnerView.get();
diff --git a/indra/llui/llbadgeowner.h b/indra/llui/llbadgeowner.h
index 53c2de95c8..01ed95f3a3 100644
--- a/indra/llui/llbadgeowner.h
+++ b/indra/llui/llbadgeowner.h
@@ -45,6 +45,7 @@ public:
bool hasBadgeHolderParent() const { return mHasBadgeHolderParent; };
void setBadgeVisibility(bool visible);
+ void setDrawBadgeAtTop(bool draw_at_top);
private: