summaryrefslogtreecommitdiff
path: root/indra/llui/lltextutil.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2016-08-11 15:36:09 -0400
committerOz Linden <oz@lindenlab.com>2016-08-11 15:36:09 -0400
commit6ff420d705625fef4b0456c19bb9c766cabb31af (patch)
tree16c27571df04932dd830b35e06cdf4e9b5dbf07e /indra/llui/lltextutil.cpp
parentc32b27f5b77c7d8e53b11163d04f2842949d71de (diff)
parent4fb100ac7a33174883184f1320d0beac08ead3a7 (diff)
merge changes for 4.0.7-release
Diffstat (limited to 'indra/llui/lltextutil.cpp')
-rw-r--r--indra/llui/lltextutil.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/llui/lltextutil.cpp b/indra/llui/lltextutil.cpp
index fff04b34f2..f6b2ee1dc0 100644
--- a/indra/llui/lltextutil.cpp
+++ b/indra/llui/lltextutil.cpp
@@ -56,6 +56,26 @@ void LLTextUtil::textboxSetHighlightedVal(LLTextBox *txtbox, const LLStyle::Para
txtbox->appendText(text.substr(hl_begin + hl_len), false, normal_style);
}
+void LLTextUtil::textboxSetGreyedVal(LLTextBox *txtbox, const LLStyle::Params& normal_style, const std::string& text, const std::string& greyed)
+{
+ static LLUIColor sGreyedTextColor = LLUIColorTable::instance().getColor("Gray", LLColor4::grey);
+
+ size_t greyed_begin = 0, greyed_len = greyed.size();
+
+ if (greyed_len == 0 || (greyed_begin = text.find(greyed)) == std::string::npos)
+ {
+ txtbox->setText(text, normal_style);
+ return;
+ }
+
+ LLStyle::Params greyed_style = normal_style;
+ greyed_style.color = sGreyedTextColor;
+ txtbox->setText(LLStringUtil::null); // clear text
+ txtbox->appendText(text.substr(0, greyed_begin), false, normal_style);
+ txtbox->appendText(text.substr(greyed_begin, greyed_len), false, greyed_style);
+ txtbox->appendText(text.substr(greyed_begin + greyed_len), false, normal_style);
+}
+
const std::string& LLTextUtil::formatPhoneNumber(const std::string& phone_str)
{
static const std::string PHONE_SEPARATOR = LLUI::sSettingGroups["config"]->getString("AvalinePhoneSeparator");