From 06bfcd7e75a2659ba4eb2dd79e89b8476a3c33cf Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 21 Aug 2024 12:27:18 +0800 Subject: Arrival time in nearby tab (draft) The period got updated to something more frequent (from 5 to 1 second). I copied from newview/llpanelpeople.cpp and updateLastInteractionTime. The values are still not accurate, and have a delayed start. The presentation could use something like std's strftime, but I started from what worked first, which was using LL's formatSeconds. The alignments really need some tidying up too. --- indra/newview/llavatarlistitem.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'indra/newview/llavatarlistitem.cpp') diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index dd0e2d83d3..a840afa967 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -65,6 +65,7 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) LLFriendObserver(), mAvatarIcon(NULL), mAvatarName(NULL), + mAvatarArrivalTime(NULL), mAvatarDistance(NULL), mLastInteractionTime(NULL), mIconPermissionOnline(NULL), @@ -108,6 +109,7 @@ BOOL LLAvatarListItem::postBuild() { mAvatarIcon = getChild("avatar_icon"); mAvatarName = getChild("avatar_name"); + mAvatarArrivalTime = getChild("avatar_arrival_time"); mAvatarDistance = getChild("avatar_distance"); mLastInteractionTime = getChild("last_interaction"); @@ -303,6 +305,17 @@ 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); @@ -552,7 +565,10 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item) 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->mAvatarName->getRect().mLeft; + 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; @@ -562,6 +578,7 @@ 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; @@ -683,6 +700,9 @@ 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; -- cgit v1.3