From 70fd0be39a35b3384cac802cf6107ffbc902cf90 Mon Sep 17 00:00:00 2001 From: Zi Ree Date: Sat, 21 Aug 2021 19:34:45 +0200 Subject: [PATCH] FIRE-30994 - Show tooltip with profile notes in radar when hovered over N icon --- indra/llui/llscrolllistctrl.cpp | 4 +++- indra/newview/fspanelradar.cpp | 3 ++- indra/newview/fsradar.cpp | 4 ++-- indra/newview/fsradarentry.cpp | 5 +++-- indra/newview/fsradarentry.h | 10 +++++----- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 98c0919800..f1501cbd73 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1905,7 +1905,9 @@ BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, MASK mask) LLScrollListCell* hit_cell = hit_item->getColumn(column_index); if (!hit_cell) return FALSE; if (hit_cell - && hit_cell->isText() + // Why would we restrict tool tips to text fields only? + // Having them on non-text fields seems really useful + // && hit_cell->isText() && hit_cell->needsToolTip()) { S32 row_index = getItemIndex(hit_item); diff --git a/indra/newview/fspanelradar.cpp b/indra/newview/fspanelradar.cpp index 8334d58e28..e6e0d7c5d5 100644 --- a/indra/newview/fspanelradar.cpp +++ b/indra/newview/fspanelradar.cpp @@ -389,7 +389,8 @@ void FSPanelRadar::updateList(const std::vector& entries, const LLSD& stat row_data["columns"][6]["column"] = "has_notes"; row_data["columns"][6]["type"] = "icon"; - row_data["columns"][6]["value"] = (entry["has_notes"].asBoolean() ? notesColumnIcon : ""); + row_data["columns"][6]["value"] = (entry["notes"].asBoolean() ? notesColumnIcon : ""); + row_data["columns"][6]["tool_tip"] = entry["notes"].asString(); row_data["columns"][7]["column"] = "age"; row_data["columns"][7]["value"] = entry["age"]; diff --git a/indra/newview/fsradar.cpp b/indra/newview/fsradar.cpp index c50b04578c..4d495c6470 100644 --- a/indra/newview/fsradar.cpp +++ b/indra/newview/fsradar.cpp @@ -528,7 +528,7 @@ void FSRadar::updateRadarList() if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { - entry["has_notes"] = ent->hasNotes(); + entry["notes"] = ent->getNotes(); entry["age"] = (avAge > -1 ? llformat("%d", avAge) : ""); if (ent->hasAlertAge()) { @@ -547,7 +547,7 @@ void FSRadar::updateRadarList() } else { - entry["has_notes"] = false; + entry["notes"] = LLStringUtil::null; entry["age"] = "---"; } diff --git a/indra/newview/fsradarentry.cpp b/indra/newview/fsradarentry.cpp index 2504b1c5c9..38bb6839e2 100644 --- a/indra/newview/fsradarentry.cpp +++ b/indra/newview/fsradarentry.cpp @@ -48,7 +48,7 @@ FSRadarEntry::FSRadarEntry(const LLUUID& avid) mAge(-1), mIsLinden(false), mIgnore(false), - mHasNotes(false), + mNotes(LLStringUtil::null), mAlertAge(false), mAgeAlertPerformed(false), mAvatarNameCallbackConnection() @@ -126,7 +126,8 @@ void FSRadarEntry::processProperties(void* data, EAvatarProcessorType type) LLAvatarNotes* avatar_notes = static_cast(data); if (avatar_notes && avatar_notes->agent_id == gAgentID && avatar_notes->target_id == mID) { - mHasNotes = !avatar_notes->notes.empty(); + mNotes = avatar_notes->notes; + LLStringUtil::trim(mNotes); } } } diff --git a/indra/newview/fsradarentry.h b/indra/newview/fsradarentry.h index c179f44b8d..30c1599378 100644 --- a/indra/newview/fsradarentry.h +++ b/indra/newview/fsradarentry.h @@ -41,9 +41,10 @@ public: ~FSRadarEntry(); LLUUID getId() const { return mID; } - std::string getName() const { return mName; } - std::string getUserName() const { return mUserName; } - std::string getDisplayName() const { return mDisplayName; } + const std::string& getName() const { return mName; } + const std::string& getUserName() const { return mUserName; } + const std::string& getDisplayName() const { return mDisplayName; } + const std::string& getNotes() const { return mNotes; } F32 getRange() const { return mRange; } LLVector3d getGlobalPos() const { return mGlobalPos; } LLUUID getRegion() const { return mRegion; } @@ -54,7 +55,6 @@ public: time_t getLastZOffsetTime() const { return mLastZOffsetTime; } bool getIsLinden() const { return mIsLinden; } bool getIgnore() const { return mIgnore; } - bool hasNotes() const { return mHasNotes; } bool hasAlertAge() const { return mAlertAge; } bool hasAgeAlertPerformed() const { return mAgeAlertPerformed; } @@ -72,6 +72,7 @@ private: std::string mName; std::string mUserName; std::string mDisplayName; + std::string mNotes; F32 mRange; LLVector3d mGlobalPos; LLUUID mRegion; @@ -82,7 +83,6 @@ private: time_t mLastZOffsetTime; bool mIsLinden; bool mIgnore; - bool mHasNotes; bool mAlertAge; bool mAgeAlertPerformed;