summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rwxr-xr-xindra/llui/lltextbase.cpp34
1 files changed, 24 insertions, 10 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 602a703450..031db31729 100755
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2063,18 +2063,10 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
// output the styled Url
appendAndHighlightTextImpl(match.getLabel(), part, link_params, match.underlineOnHoverOnly());
+ bool tooltip_required = !match.getTooltip().empty();
- // show query part of url with gray color only for LLUrlEntryHTTP and LLUrlEntryHTTPNoProtocol url entries
- std::string label = match.getQuery();
- if (label.size())
- {
- link_params.color = LLColor4::grey;
- link_params.readonly_color = LLColor4::grey;
- appendAndHighlightTextImpl(label, part, link_params, match.underlineOnHoverOnly());
- }
-
// set the tooltip for the Url label
- if (! match.getTooltip().empty())
+ if (tooltip_required)
{
segment_set_t::iterator it = getSegIterContaining(getLength()-1);
if (it != mSegments.end())
@@ -2084,6 +2076,28 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
}
}
+
+
+ // show query part of url with gray color only for LLUrlEntryHTTP url entries
+ std::string label = match.getQuery();
+ if (label.size())
+ {
+ link_params.color = LLColor4::grey;
+ link_params.readonly_color = LLColor4::grey;
+ appendAndHighlightTextImpl(label, part, link_params, match.underlineOnHoverOnly());
+
+ // set the tooltip for the query part of url
+ if (tooltip_required)
+ {
+ segment_set_t::iterator it = getSegIterContaining(getLength()-1);
+ if (it != mSegments.end())
+ {
+ LLTextSegmentPtr segment = *it;
+ segment->setToolTip(match.getTooltip());
+ }
+ }
+ }
+
// move on to the rest of the text after the Url
if (end < (S32)text.length())
{