From 164e1073952060cf88a163945d6745934db62620 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Tue, 5 Jun 2012 18:20:01 +0300 Subject: CHUI-103 Added square brackets to a messages from Second Life in the plain text mode; changed the default colors of user's messages --- indra/newview/llchathistory.cpp | 8 ++++++++ indra/newview/skins/default/colors.xml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index c514261b60..cfc70a1b0e 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -693,6 +693,7 @@ void LLChatHistory::clear() void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LLStyle::Params& input_append_params) { bool use_plain_text_chat_history = args["use_plain_text_chat_history"].asBoolean(); + bool square_brackets = false; // square brackets necessary for a system messages llassert(mEditor); if (!mEditor) @@ -781,6 +782,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // show timestamps and names in the compact mode if (use_plain_text_chat_history) { + square_brackets = chat.mFromName == SYSTEM_FROM; + LLStyle::Params timestamp_style(style_params); // timestams showing @@ -942,6 +945,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL message = chat.mFromName + message; } + if (square_brackets) + { + message = "[" + message + "]"; + } + mEditor->appendText(message, prependNewLineState, style_params); prependNewLineState = false; } diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index b616e2327b..5205988d5d 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -766,7 +766,7 @@ reference="LtGray" /> + reference="Yellow" /> -- cgit v1.2.3 From 33adfe09474c58075d58feff1fc34e24503d3e80 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 8 Jun 2012 19:51:56 +0300 Subject: CHUI-103 FIXED Added a square brackets to system messages; changed a default color for user messages --- indra/newview/llchathistory.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index cfc70a1b0e..dcd6d25888 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -737,7 +737,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLViewerChat::getChatColor(chat,txt_color); LLFontGL* fontp = LLViewerChat::getChatFont(); std::string font_name = LLFontGL::nameFromFont(fontp); - std::string font_size = LLFontGL::sizeFromFont(fontp); + std::string font_size = LLFontGL::sizeFromFont(fontp); + LLStyle::Params style_params; style_params.color(txt_color); style_params.readonly_color(txt_color); @@ -773,8 +774,9 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // We graying out chat history by graying out messages that contains full date in a time string if (message_from_log) { - style_params.color(LLColor4::grey); - style_params.readonly_color(LLColor4::grey); + txt_color = LLColor4::grey; + style_params.color(txt_color); + style_params.readonly_color(txt_color); } bool prependNewLineState = mEditor->getText().size() != 0; @@ -786,7 +788,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLStyle::Params timestamp_style(style_params); - // timestams showing + // out of the timestamp if (args["show_time"].asBoolean()) { if (!message_from_log) @@ -799,6 +801,13 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL prependNewLineState = false; } + // out the opening square bracket (if need) + if (square_brackets) + { + mEditor->appendText("[", prependNewLineState, style_params); + prependNewLineState = false; + } + // names showing if (args["show_names_for_p2p_conv"].asBoolean() && utf8str_trim(chat.mFromName).size() != 0) { @@ -947,7 +956,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (square_brackets) { - message = "[" + message + "]"; + message += "]"; } mEditor->appendText(message, prependNewLineState, style_params); -- cgit v1.2.3