summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
authorIgor Borovkov <iborovkov@productengine.com>2010-02-03 16:25:32 +0200
committerIgor Borovkov <iborovkov@productengine.com>2010-02-03 16:25:32 +0200
commitcb03e6f92a5d89056ef83e97fe436a165bb3ae78 (patch)
tree8ff50226830761179ec5faf9020fbc58143acf59 /indra/newview/llchathistory.cpp
parent6ebbc5edf6c95f68088577f82b2c1daf73b68205 (diff)
fixed EXT-4776 Make avatars in nearby chat inspectable
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 64226ac52b..a351c52ce2 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -53,7 +53,9 @@
#include "llagent.h"
#include "llnotificationsutil.h"
#include "lltoastnotifypanel.h"
+#include "lltooltip.h"
#include "llviewerregion.h"
+#include "llviewertexteditor.h"
#include "llworld.h"
#include "lluiconstants.h"
@@ -111,6 +113,34 @@ public:
return LLPanel::handleMouseUp(x,y,mask);
}
+ //*TODO remake it using mouse enter/leave and static LLHandle<LLIconCtrl> to add/remove as a child
+ BOOL handleToolTip(S32 x, S32 y, MASK mask)
+ {
+ LLViewerTextEditor* name = getChild<LLViewerTextEditor>("user_name");
+ if (name && name->parentPointInView(x, y) && mAvatarID.notNull() && SYSTEM_FROM != mFrom)
+ {
+
+ // Spawn at right side of the name textbox.
+ LLRect sticky_rect = name->calcScreenRect();
+ S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3);
+
+ LLToolTip::Params params;
+ params.background_visible(false);
+ params.click_callback(boost::bind(&LLChatHistoryHeader::onHeaderPanelClick, this, 0, 0, 0));
+ params.delay_time(0.0f); // spawn instantly on hover
+ params.image(LLUI::getUIImage("Info_Small"));
+ params.message("");
+ params.padding(0);
+ params.pos(LLCoordGL(icon_x, sticky_rect.mTop - 2));
+ params.sticky_rect(sticky_rect);
+
+ LLToolTipMgr::getInstance()->show(params);
+ return TRUE;
+ }
+
+ return LLPanel::handleToolTip(x, y, mask);
+ }
+
void onObjectIconContextMenuItemClicked(const LLSD& userdata)
{
std::string level = userdata.asString();