Fix chat header color selection

master
Ansariel 2020-07-17 08:38:09 +02:00
parent c578f8007b
commit 1dfcb2ddf6
4 changed files with 21 additions and 2 deletions

View File

@ -42,7 +42,10 @@ LLStyle::Params::Params()
image("image"),
link_href("href"),
is_link("is_link"),
use_default_link_style("use_default_link_style", true) // <FS:Ansariel> Don't highlight URLs on hover if font style contains underline
// <FS:Ansariel> Don't highlight URLs on hover if font style contains underline
use_default_link_style("use_default_link_style", true),
is_chat_header("is_chat_header", false)
// </FS:Ansariel>
{}

View File

@ -48,7 +48,10 @@ public:
Optional<LLUIImage*> image;
Optional<std::string> link_href;
Optional<bool> is_link;
Optional<bool> use_default_link_style; // <FS:Ansariel> Don't highlight URLs on hover if font style contains underline
// <FS:Ansariel> Don't highlight URLs on hover if font style contains underline
Optional<bool> use_default_link_style;
Optional<bool> is_chat_header;
// </FS:Ansariel>
Params();
};
LLStyle(const Params& p = Params());

View File

@ -2257,8 +2257,20 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
LLStyle::Params link_params(style_params);
// <FS:Ansariel> Overwrite only if we explicitly allow it
//link_params.overwriteFrom(match.getStyle());
if (input_params.use_default_link_style)
{
LLUIColor color(link_params.color());
LLUIColor readonly_color(link_params.readonly_color());
bool is_chat_header = link_params.is_chat_header();
link_params.overwriteFrom(match.getStyle());
if (is_chat_header)
{
link_params.color = color;
link_params.readonly_color = readonly_color;
}
}
// </FS:Ansariel>
// output the text before the Url
if (start > 0)

View File

@ -1258,6 +1258,7 @@ void FSChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
LLStyle::Params name_params(body_message_params);
name_params.color(name_color);
name_params.readonly_color(name_color);
name_params.is_chat_header(true);
// FS:LO FIRE-2899 - Faded text for IMs in nearby chat
F32 FSIMChatHistoryFade = gSavedSettings.getF32("FSIMChatHistoryFade");