diff options
author | Andrew Dyukov <adyukov@productengine.com> | 2010-07-26 18:10:29 +0300 |
---|---|---|
committer | Andrew Dyukov <adyukov@productengine.com> | 2010-07-26 18:10:29 +0300 |
commit | 4919f0b341804680a90818386b8f8ccf0a5f5f81 (patch) | |
tree | b63308e612da0a6fdab7d4192ae4c51082404795 /indra/llui/llurlentry.cpp | |
parent | 8f64727254355a7734e6b3443b2b6ed6f94b2a57 (diff) |
EXT-8010 FIXED Implemented special behaviour of avatar links.
Avatar links are now underlined only on hover. Also they have the same color as other links.
- Underlining text and getting it back to normal are done in handleHover() and draw() of new LLOnHoverChangeableTextSegment
class derived from LLNormalTextSegment. This class has two pointers to styles- one for style which will be used for text
on hover, and another otherwise. This special type of text segment is used if link's boolean member mUnderlineOnHoverOnly
is true. So it is URL's flag depending on which textbase adds new text segment(like it currently happens with mDisabledLink).
- Changed avatar link color in colors.xml to emphasis (because it was white before and was inconsistent with other links).
Reviewed by Richard Nelson at https://codereview.productengine.com/secondlife/r/749/
--HG--
branch : product-engine
Diffstat (limited to 'indra/llui/llurlentry.cpp')
-rw-r--r-- | indra/llui/llurlentry.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index e075699a6e..17d211fb36 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -363,6 +363,12 @@ std::string LLUrlEntryAgent::getTooltip(const std::string &string) const return LLTrans::getString("TooltipAgentUrl"); } +bool LLUrlEntryAgent::underlineOnHoverOnly(const std::string &string) const +{ + std::string url = getUrl(string); + return LLStringUtil::endsWith(url, "/about"); +} + std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { if (!gCacheName) @@ -730,6 +736,19 @@ std::string LLUrlEntrySLLabel::getTooltip(const std::string &string) const return LLUrlEntryBase::getTooltip(string); } +bool LLUrlEntrySLLabel::underlineOnHoverOnly(const std::string &string) const +{ + std::string url = getUrl(string); + LLUrlMatch match; + if (LLUrlRegistry::instance().findUrl(url, match)) + { + return match.underlineOnHoverOnly(); + } + + // unrecognized URL? should not happen + return LLUrlEntryBase::underlineOnHoverOnly(string); +} + // // LLUrlEntryWorldMap Describes secondlife:///<location> URLs // |