summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 2ccd6b7d35..d1922cfd6e 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -47,7 +47,6 @@
#include "llmutelist.h"
static LLDefaultChildRegistry::Register<LLChatHistory> r("chat_history");
-static const std::string MESSAGE_USERNAME_DATE_SEPARATOR(" ----- ");
std::string formatCurrentTime()
{
@@ -175,7 +174,7 @@ public:
const std::string& getFirstName() const { return mFirstName; }
const std::string& getLastName () const { return mLastName; }
- void setup(const LLChat& chat)
+ void setup(const LLChat& chat,const LLStyle::Params& style_params)
{
mAvatarID = chat.mFromID;
mSourceType = chat.mSourceType;
@@ -185,8 +184,11 @@ public:
mSourceType = CHAT_SOURCE_SYSTEM;
}
-
LLTextBox* userName = getChild<LLTextBox>("user_name");
+
+ LLUIColor color = style_params.color;
+ userName->setReadOnlyColor(color);
+ userName->setColor(color);
if(!chat.mFromName.empty())
{
@@ -198,6 +200,7 @@ public:
std::string SL = LLTrans::getString("SECOND_LIFE");
userName->setValue(SL);
}
+
LLTextBox* timeBox = getChild<LLTextBox>("time_box");
timeBox->setValue(formatCurrentTime());
@@ -323,17 +326,17 @@ LLView* LLChatHistory::getSeparator()
return separator;
}
-LLView* LLChatHistory::getHeader(const LLChat& chat)
+LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style_params)
{
LLChatHistoryHeader* header = LLChatHistoryHeader::createInstance(mMessageHeaderFilename);
- header->setup(chat);
+ header->setup(chat,style_params);
return header;
}
void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& style_params)
{
LLView* view = NULL;
- std::string view_text;
+ std::string view_text = "\n[" + formatCurrentTime() + "] " + chat.mFromName + ": ";
LLInlineViewSegment::Params p;
p.force_newline = true;
@@ -343,14 +346,12 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& sty
if (mLastFromName == chat.mFromName)
{
view = getSeparator();
- view_text = "\n";
p.top_pad = mTopSeparatorPad;
p.bottom_pad = mBottomSeparatorPad;
}
else
{
- view = getHeader(chat);
- view_text = chat.mFromName + MESSAGE_USERNAME_DATE_SEPARATOR + formatCurrentTime() + '\n';
+ view = getHeader(chat,style_params);
if (getText().size() == 0)
p.top_pad = 0;
else
@@ -370,10 +371,8 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& sty
appendWidget(p, view_text, false);
//Append the text message
- std::string message = chat.mText + '\n';
- appendText(message, FALSE, style_params);
+ appendText(chat.mText, FALSE, style_params);
mLastFromName = chat.mFromName;
blockUndo();
- setCursorAndScrollToEnd();
}