diff options
author | Merov Linden <merov@lindenlab.com> | 2013-05-10 18:29:00 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-05-10 18:29:00 -0700 |
commit | cc87c6785258cb04f11cb79ce2e9899d33f11e03 (patch) | |
tree | fcc057e96fbd8af5a5664bf4036d79ce4c6e92e0 /indra/newview/llpersontabview.cpp | |
parent | 7c4bfc8f55ebc581ddac0c2394b07b24d240d1a6 (diff) | |
parent | fb27eae15502cbd2a13cde018ae67f961320d0ba (diff) |
Pull merge from viewer-fbc
Diffstat (limited to 'indra/newview/llpersontabview.cpp')
-rw-r--r-- | indra/newview/llpersontabview.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 6aa51febcb..34ffc6ffce 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -173,6 +173,8 @@ S32 LLPersonView::getLabelXPos() void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) { + const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); + LLFolderViewItem::addToFolder(person_folder_view); //Added item to folder could change folder's mHasVisibleChildren flag so call arrange person_folder_view->requestArrange(); @@ -182,6 +184,18 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) { mAvatarIcon->setVisible(TRUE); + mFacebookIcon->setVisible(TRUE); + + S32 label_width = font->getWidth(mLabel); + F32 text_left = (F32)getLabelXPos(); + + LLRect mFacebookIconRect = mFacebookIcon->getRect(); + S32 new_left = text_left + label_width + 7; + mFacebookIconRect.set(new_left, + mFacebookIconRect.mTop, + new_left + mFacebookIconRect.getWidth(), + mFacebookIconRect.mBottom); + mFacebookIcon->setRect(mFacebookIconRect); } else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND) { @@ -286,7 +300,14 @@ void LLPersonView::draw() F32 right_x = 0; drawHighlight(); - drawLabel(font, text_left, y, color, right_x); + if(mLabel.length()) + { + drawLabel(mLabel, font, text_left, y, color, right_x); + } + if(mLabelSuffix.length()) + { + drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x); + } LLView::draw(); } @@ -317,6 +338,13 @@ void LLPersonView::drawHighlight() } } +void LLPersonView::drawLabel(const std::string text, const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x) +{ + font->renderUTF8(text, 0, x, y, color, + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, + S32_MAX, getRect().getWidth() - (S32) x - mLabelPaddingRight, &right_x, TRUE); +} + void LLPersonView::initFromParams(const LLPersonView::Params & params) { LLIconCtrl::Params facebook_icon_params(params.facebook_icon()); |