diff options
author | Leslie Linden <none@none> | 2011-07-11 17:45:29 -0700 |
---|---|---|
committer | Leslie Linden <none@none> | 2011-07-11 17:45:29 -0700 |
commit | 18e8d57b210fd5a7ca1bb8fc114a3e4faf8bf537 (patch) | |
tree | 114e914298bd5d06cb5082a81731d9f45580428e /indra/llui/llbadge.cpp | |
parent | 85ddc48e089b8c0b64ca8c224d0cbf1e1509a9c3 (diff) |
EXP-995 FIX -- New icon scrolls into Received Items panel heading
EXP-903 FIX -- Newness/Freshness number does not decrease as items are opened in Inbox
* Brought back freshness with the freshness
* New badge and label color from Gibson
* Inventory Panel now allows display of badges with proper clipping
Reviewed by Richard.
Diffstat (limited to 'indra/llui/llbadge.cpp')
-rw-r--r-- | indra/llui/llbadge.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index c28a947a7f..fde3c53a65 100644 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -43,6 +43,8 @@ LLBadge::Params::Params() , image_color("image_color") , label("label") , label_color("label_color") + , label_offset_horiz("label_offset_horiz") + , label_offset_vert("label_offset_vert") , location("location", LLRelPos::TOP_LEFT) , location_percent_hcenter("location_percent_hcenter") , location_percent_vcenter("location_percent_vcenter") @@ -65,6 +67,8 @@ bool LLBadge::Params::equals(const Params& a) const comp &= (image_color() == a.image_color()); comp &= (label() == a.label()); comp &= (label_color() == a.label_color()); + comp &= (label_offset_horiz() == a.label_offset_horiz()); + comp &= (label_offset_vert() == a.label_offset_vert()); comp &= (location() == a.location()); comp &= (location_percent_hcenter() == a.location_percent_hcenter()); comp &= (location_percent_vcenter() == a.location_percent_vcenter()); @@ -84,6 +88,8 @@ LLBadge::LLBadge(const LLBadge::Params& p) , mImageColor(p.image_color) , mLabel(p.label) , mLabelColor(p.label_color) + , mLabelOffsetHoriz(p.label_offset_horiz) + , mLabelOffsetVert(p.label_offset_vert) , mLocation(p.location) , mLocationPercentHCenter(0.5f) , mLocationPercentVCenter(0.5f) @@ -131,6 +137,18 @@ LLBadge::~LLBadge() { } +bool LLBadge::addToView(LLView * view) +{ + bool child_added = view->addChild(this); + + if (child_added) + { + setShape(view->getLocalRect()); + } + + return child_added; +} + void LLBadge::setLabel(const LLStringExplicit& label) { mLabel = label; @@ -241,8 +259,10 @@ void LLBadge::draw() // Draw the label // - mGLFont->render(badge_label_wstring, badge_label_begin_offset, - badge_center_x, badge_center_y, + mGLFont->render(badge_label_wstring, + badge_label_begin_offset, + badge_center_x + mLabelOffsetHoriz, + badge_center_y + mLabelOffsetVert, mLabelColor % alpha, LLFontGL::HCENTER, LLFontGL::VCENTER, // centered around the position LLFontGL::NORMAL, // normal text (not bold, italics, etc.) |