summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorKitty Barnett <develop@catznip.com>2022-10-23 16:37:10 +0200
committerKitty Barnett <develop@catznip.com>2022-10-23 16:29:03 +0200
commit8d08f417dc1f5b2681774f000951993e0f0cf79f (patch)
treea31a769fac1ebdad324d0953ff69e22e0814d716 /indra/llui/lltextbase.cpp
parentf6f52d327be5f03265d66a95df6fc0716f91ca07 (diff)
Show tooltip when hovering over an emoji text segment (currently will show its shortcode)
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r--indra/llui/lltextbase.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 2a6e6901e4..693dcb7b8d 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -3557,6 +3557,20 @@ LLEmojiTextSegment::LLEmojiTextSegment(const LLColor4& color, S32 start, S32 end
{
}
+BOOL LLEmojiTextSegment::handleToolTip(S32 x, S32 y, MASK mask)
+{
+ if (mTooltip.empty())
+ {
+ LLWString emoji = getWText().substr(getStart(), getEnd() - getStart());
+ if (!emoji.empty())
+ {
+ mTooltip = LLEmojiHelper::instance().getToolTip(emoji[0]);
+ }
+ }
+
+ return LLNormalTextSegment::handleToolTip(x, y, mask);
+}
+
//
// LLOnHoverChangeableTextSegment
//