diff options
Diffstat (limited to 'indra/newview/llavatarlistitem.cpp')
-rw-r--r-- | indra/newview/llavatarlistitem.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 880910d18e..7be4f4eeb8 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -65,6 +65,8 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) LLFriendObserver(), mAvatarIcon(NULL), mAvatarName(NULL), + mAvatarArrivalTime(NULL), + mAvatarDistance(NULL), mLastInteractionTime(NULL), mIconPermissionOnline(NULL), mIconPermissionMap(NULL), @@ -107,6 +109,8 @@ bool LLAvatarListItem::postBuild() { mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon"); mAvatarName = getChild<LLTextBox>("avatar_name"); + mAvatarArrivalTime = getChild<LLTextBox>("avatar_arrival_time"); + mAvatarDistance = getChild<LLTextBox>("avatar_distance"); mLastInteractionTime = getChild<LLTextBox>("last_interaction"); mIconPermissionOnline = getChild<LLIconCtrl>("permission_online_icon"); @@ -301,6 +305,28 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, b } } +void LLAvatarListItem::showAvatarArrivalTime(bool show) +{ + mAvatarArrivalTime->setVisible(show); + updateChildren(); +} + +void LLAvatarListItem::setAvatarArrivalTime(F32 arrival_time) +{ + mAvatarArrivalTime->setValue(formatSeconds(arrival_time)); +} + +void LLAvatarListItem::showAvatarDistance(bool show) +{ + mAvatarDistance->setVisible(show); + updateChildren(); +} + +void LLAvatarListItem::setAvatarDistance(F32 distance) +{ + mAvatarDistance->setValue(llformat("%.1f m", distance)); +} + void LLAvatarListItem::showLastInteractionTime(bool show) { mLastInteractionTime->setVisible(show); @@ -538,6 +564,12 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item) // last interaction time textbox width + padding S32 last_interaction_time_width = avatar_item->mIconPermissionEditTheirs->getRect().mLeft - avatar_item->mLastInteractionTime->getRect().mLeft; + // avatar distance textbox width + padding + S32 avatar_distance_width = avatar_item->mAvatarDistance->getRect().mLeft - avatar_item->mAvatarArrivalTime->getRect().mLeft; + + // avatar arrival time textbox width + padding + S32 avatar_arrival_time = avatar_item->mAvatarArrivalTime->getRect().mLeft - avatar_item->mAvatarName->getRect().mLeft; + // avatar icon width + padding S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft; @@ -546,6 +578,8 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item) S32 index = ALIC_COUNT; sChildrenWidths[--index] = icon_width; sChildrenWidths[--index] = 0; // for avatar name we don't need its width, it will be calculated as "left available space" + sChildrenWidths[--index] = avatar_arrival_time; + sChildrenWidths[--index] = avatar_distance_width; sChildrenWidths[--index] = last_interaction_time_width; sChildrenWidths[--index] = permission_edit_theirs_width; sChildrenWidths[--index] = permission_edit_mine_width; @@ -666,6 +700,12 @@ LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_ case ALIC_NAME: child_view = mAvatarName; break; + case ALIC_ARRIVAL_TIME: + child_view = mAvatarArrivalTime; + break; + case ALIC_DISTANCE: + child_view = mAvatarDistance; + break; case ALIC_INTERACTION_TIME: child_view = mLastInteractionTime; break; |