summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Mutavchi <emutavchi@productengine.com>2009-11-12 19:54:45 +0200
committerEugene Mutavchi <emutavchi@productengine.com>2009-11-12 19:54:45 +0200
commit978dd80c963911372b0d311fec01b9d4de279c11 (patch)
tree9230026c2743c0342813e5d463c8fb02c9195120
parent181ac27742ff8c7b7aaff10cc1f382fd41994ccd (diff)
Implemented major sub-task EXT-2364 (Items in group/ad-hoc IM participant list (avatar names) should be reshaped when adding/removing the "(Moderator)" label)
--HG-- branch : product-engine
-rw-r--r--indra/newview/llavatarlistitem.cpp15
-rw-r--r--indra/newview/llavatarlistitem.h2
-rw-r--r--indra/newview/llparticipantlist.cpp2
3 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp
index 7df278d887..c670a65bcc 100644
--- a/indra/newview/llavatarlistitem.cpp
+++ b/indra/newview/llavatarlistitem.cpp
@@ -311,3 +311,18 @@ void LLAvatarListItem::onNameCache(const std::string& first_name, const std::str
mAvatarName->setValue(name);
mAvatarName->setToolTip(name);
}
+
+void LLAvatarListItem::reshapeAvatarName()
+{
+ S32 width_delta = 0;
+ width_delta += mShowProfileBtn ? mProfileBtnWidth : 0;
+ width_delta += mSpeakingIndicator->getVisible() ? mSpeakingIndicatorWidth : 0;
+ width_delta += mAvatarIcon->getVisible() ? mIconWidth : 0;
+ width_delta += mShowInfoBtn ? mInfoBtnWidth : 0;
+ width_delta += mLastInteractionTime->getVisible() ? mLastInteractionTime->getRect().getWidth() : 0;
+
+ S32 height = mAvatarName->getRect().getHeight();
+ S32 width = getRect().getWidth() - width_delta;
+
+ mAvatarName->reshape(width, height);
+}
diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h
index d379797a46..9d48101a44 100644
--- a/indra/newview/llavatarlistitem.h
+++ b/indra/newview/llavatarlistitem.h
@@ -82,6 +82,8 @@ public:
void setContextMenu(ContextMenu* menu) { mContextMenu = menu; }
+ void reshapeAvatarName();
+
private:
typedef enum e_online_status {
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index f5367c0477..13bd059d45 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -130,6 +130,7 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
{
name.erase(found, moderator_indicator_len);
item->setName(name);
+ item->reshapeAvatarName();
}
}
}
@@ -151,6 +152,7 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
name += " ";
name += moderator_indicator;
item->setName(name);
+ item->reshapeAvatarName();
}
}
}