diff options
author | Steve Bennetts <steve@lindenlab.com> | 2009-11-11 14:56:51 -0800 |
---|---|---|
committer | Steve Bennetts <steve@lindenlab.com> | 2009-11-11 14:56:51 -0800 |
commit | 064c91ae520fb157ed8ed314e43ce87e0a3bab99 (patch) | |
tree | 5fb550989d1f458aa52f408fb2d7c67da4f5c8aa /indra/newview/llchathistory.cpp | |
parent | 310ce5527526d36cb2e66aafb00c177e352c80c7 (diff) | |
parent | b4e3d34791497188537680a4556ccacaa004db09 (diff) |
Merge from product-engine
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r-- | indra/newview/llchathistory.cpp | 23 |
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(); } |