Add LLTextEditor::setLinkColor for when links need to be another color!
This fixes blue on blue in notices for the classic skin, while it does affect other skins, it's not very noticeable. Actually this change kinda makes links match skins better overall...
This commit is contained in:
@@ -274,6 +274,7 @@ LLTextEditor::LLTextEditor(
|
||||
mWriteableBgColor(LLUI::sColorsGroup->getColor("TextBgWriteableColor")),
|
||||
mReadOnlyBgColor(LLUI::sColorsGroup->getColor("TextBgReadOnlyColor")),
|
||||
mFocusBgColor(LLUI::sColorsGroup->getColor("TextBgFocusColor")),
|
||||
mLinkColor(nullptr),
|
||||
mReadOnly(parse_html),
|
||||
mWordWrap(FALSE),
|
||||
mShowLineNumbers(FALSE),
|
||||
@@ -378,6 +379,11 @@ LLTextEditor::LLTextEditor(
|
||||
LLTextEditor::~LLTextEditor()
|
||||
{
|
||||
gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit()
|
||||
if (mLinkColor)
|
||||
{
|
||||
delete mLinkColor;
|
||||
mLinkColor = nullptr;
|
||||
}
|
||||
|
||||
// Scrollbar is deleted by LLView
|
||||
|
||||
@@ -4187,7 +4193,7 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s
|
||||
LLUrlMatch match;
|
||||
LLStyleSP link_style(new LLStyle);
|
||||
if (style) *link_style = *style;
|
||||
link_style->setColor(LLUI::sConfigGroup->getColor4("HTMLLinkColor"));
|
||||
link_style->setColor(mLinkColor ? *mLinkColor : LLUI::sConfigGroup->getColor4("HTMLLinkColor"));
|
||||
auto append_substr = [&](const size_t& pos, const size_t& count)
|
||||
{
|
||||
appendAndHighlightText(text.substr(pos, count), part, style);
|
||||
|
||||
@@ -260,6 +260,8 @@ public:
|
||||
|
||||
void setHandleEditKeysDirectly( BOOL b ) { mHandleEditKeysDirectly = b; }
|
||||
|
||||
// Use for when the link color needs to be changed to avoid looking awful
|
||||
void setLinkColor(LLColor4* color) { if (mLinkColor) delete mLinkColor; mLinkColor = color; }
|
||||
|
||||
void setOnScrollEndCallback(void (*callback)(void*), void* userdata);
|
||||
|
||||
@@ -504,6 +506,7 @@ private:
|
||||
// Data
|
||||
//
|
||||
LLKeywords mKeywords;
|
||||
LLColor4* mLinkColor;
|
||||
|
||||
// Concrete LLTextCmd sub-classes used by the LLTextEditor base class
|
||||
class LLTextCmdInsert;
|
||||
|
||||
Reference in New Issue
Block a user