summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-03-24 18:04:26 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2010-03-24 18:04:26 +0200
commitd3a606f8323a32c660c71675257e3abd95cb097e (patch)
tree11e272b194cb42bd9b11b861395f44793d3fa9f6 /indra/newview/llchathistory.cpp
parent5f46430a1aa16212838dd7a9493a42fcb5e92ec3 (diff)
parent7857f59f9e7c673f1ddbf32d6a66e85f78004445 (diff)
Manual merge from default branch.
Resolved conflicts in llpanellandmarks.cpp. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index e1c96d4a16..efdfbb8d20 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -447,6 +447,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p)
: LLUICtrl(p),
mMessageHeaderFilename(p.message_header),
mMessageSeparatorFilename(p.message_separator),
+ mMessagePlaintextSeparatorFilename(p.message_plaintext_separator),
mLeftTextPad(p.left_text_pad),
mRightTextPad(p.right_text_pad),
mLeftWidgetPad(p.left_widget_pad),
@@ -534,6 +535,12 @@ LLView* LLChatHistory::getSeparator()
return separator;
}
+LLView* LLChatHistory::getPlaintextSeparator()
+{
+ LLPanel* separator = LLUICtrlFactory::getInstance()->createFromFile<LLPanel>(mMessagePlaintextSeparatorFilename, NULL, LLPanel::child_registry_t::instance());
+ return separator;
+}
+
LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style_params)
{
LLChatHistoryHeader* header = LLChatHistoryHeader::createInstance(mMessageHeaderFilename);
@@ -632,6 +639,15 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
if (use_plain_text_chat_history)
{
+ // append plaintext separator
+ LLView* separator = getPlaintextSeparator();
+ LLInlineViewSegment::Params p;
+ p.force_newline = true;
+ p.left_pad = mLeftWidgetPad;
+ p.right_pad = mRightWidgetPad;
+ p.view = separator;
+ mEditor->appendWidget(p, "\n", false);
+
mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, style_params);
if (utf8str_trim(chat.mFromName).size() != 0)
@@ -734,7 +750,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId);
if (notification != NULL)
{
- LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(
+ LLIMToastNotifyPanel* notify_box = new LLIMToastNotifyPanel(
notification);
//we can't set follows in xml since it broke toasts behavior
notify_box->setFollowsLeft();
@@ -743,7 +759,9 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
ctrl_list_t ctrls = notify_box->getControlPanel()->getCtrlList();
S32 offset = 0;
- for (ctrl_list_t::iterator it = ctrls.begin(); it != ctrls.end(); it++)
+ // Children were added by addChild() which uses push_front to insert them into list,
+ // so to get buttons in correct order reverse iterator is used (EXT-5906)
+ for (ctrl_list_t::reverse_iterator it = ctrls.rbegin(); it != ctrls.rend(); it++)
{
LLButton * button = dynamic_cast<LLButton*> (*it);
if (button != NULL)
@@ -758,7 +776,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
button->getRect().mBottom));
button->setAutoResize(true);
button->autoResize();
- offset += 2 * HPAD + button->getRect().getWidth();
+ offset += HPAD + button->getRect().getWidth();
button->setFollowsNone();
}
}
@@ -817,7 +835,6 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
message = chat.mFromName + message;
}
-
mEditor->appendText(message, FALSE, style_params);
}
mEditor->blockUndo();