summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2015-07-29 12:35:54 +0300
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2015-07-29 12:35:54 +0300
commit07020ffce092d44c0fc376ab33151391e60cad52 (patch)
tree6fc03650d635babbfebbec3baa6e2ca680b2a39c
parent4495a50e8c0d9a1223160cdd8643a6ce969e3dfb (diff)
MAINT-5428 FIXED Show tooltip for both parts of url.
-rwxr-xr-xindra/llui/lltextbase.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index ca26c4f72b..031db31729 100755
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2063,6 +2063,20 @@ 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();
+
+ // set the tooltip for the Url label
+ if (tooltip_required)
+ {
+ segment_set_t::iterator it = getSegIterContaining(getLength()-1);
+ if (it != mSegments.end())
+ {
+ LLTextSegmentPtr segment = *it;
+ segment->setToolTip(match.getTooltip());
+ }
+ }
+
+
// show query part of url with gray color only for LLUrlEntryHTTP url entries
std::string label = match.getQuery();
@@ -2071,16 +2085,16 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
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())
- {
- segment_set_t::iterator it = getSegIterContaining(getLength()-1);
- if (it != mSegments.end())
+
+ // set the tooltip for the query part of url
+ if (tooltip_required)
{
- LLTextSegmentPtr segment = *it;
- segment->setToolTip(match.getTooltip());
+ segment_set_t::iterator it = getSegIterContaining(getLength()-1);
+ if (it != mSegments.end())
+ {
+ LLTextSegmentPtr segment = *it;
+ segment->setToolTip(match.getTooltip());
+ }
}
}