From 4254d1e0f7af0f8f00033bc0edaf74ddd7a49796 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Thu, 5 Nov 2009 17:10:09 +0200 Subject: Implemented normal sub-task EXT-2146-IM Message Headers should NOT be of enourmous size (see Style Guide: IM & Voice). --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 29 +++++--- indra/newview/llchathistory.h | 21 +++++- .../skins/default/xui/en/panel_chat_header.xml | 85 ++++++++++------------ .../skins/default/xui/en/panel_chat_separator.xml | 16 +--- .../skins/default/xui/en/widgets/chat_history.xml | 4 + 5 files changed, 86 insertions(+), 69 deletions(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index e561507e69..2ccd6b7d35 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -132,8 +132,7 @@ public: menu = LLUICtrlFactory::getInstance()->createFromFile("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mPopupMenuHandleObject = menu->getHandle(); - LLPanel* visible_panel = getChild("im_header"); - visible_panel->setMouseDownCallback(boost::bind(&LLChatHistoryHeader::onHeaderPanelClick, this, _2, _3, _4)); + setMouseDownCallback(boost::bind(&LLChatHistoryHeader::onHeaderPanelClick, this, _2, _3, _4)); return LLPanel::postBuild(); } @@ -290,7 +289,11 @@ mMessageSeparatorFilename(p.message_separator), mLeftTextPad(p.left_text_pad), mRightTextPad(p.right_text_pad), mLeftWidgetPad(p.left_widget_pad), -mRightWidgetPad(p.right_widget_pad) +mRightWidgetPad(p.right_widget_pad), +mTopSeparatorPad(p.top_separator_pad), +mBottomSeparatorPad(p.bottom_separator_pad), +mTopHeaderPad(p.top_header_pad), +mBottomHeaderPad(p.bottom_header_pad) { } @@ -332,16 +335,30 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& sty LLView* view = NULL; std::string view_text; + LLInlineViewSegment::Params p; + p.force_newline = true; + p.left_pad = mLeftWidgetPad; + p.right_pad = mRightWidgetPad; + 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'; + if (getText().size() == 0) + p.top_pad = 0; + else + p.top_pad = mTopHeaderPad; + p.bottom_pad = mBottomHeaderPad; } + p.view = view; + //Prepare the rect for the view LLRect target_rect = getDocumentView()->getRect(); // squeeze down the widget by subtracting padding off left and right @@ -350,12 +367,6 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& sty view->reshape(target_rect.getWidth(), view->getRect().getHeight()); view->setOrigin(target_rect.mLeft, view->getRect().mBottom); - LLInlineViewSegment::Params p; - p.view = view; - p.force_newline = true; - p.left_pad = mLeftWidgetPad; - p.right_pad = mRightWidgetPad; - appendWidget(p, view_text, false); //Append the text message diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index 92dcfdd958..3789ebff4e 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -54,6 +54,14 @@ class LLChatHistory : public LLTextEditor Optional left_widget_pad; //Widget right padding from the scroll rect Optional right_widget_pad; + //Separator top padding + Optional top_separator_pad; + //Separator bottom padding + Optional bottom_separator_pad; + //Header top padding + Optional top_header_pad; + //Header bottom padding + Optional bottom_header_pad; Params() : message_header("message_header"), @@ -61,7 +69,11 @@ class LLChatHistory : public LLTextEditor left_text_pad("left_text_pad"), right_text_pad("right_text_pad"), left_widget_pad("left_widget_pad"), - right_widget_pad("right_widget_pad") + right_widget_pad("right_widget_pad"), + top_separator_pad("top_separator_pad"), + bottom_separator_pad("bottom_separator_pad"), + top_header_pad("top_header_pad"), + bottom_header_pad("bottom_header_pad") { } @@ -105,9 +117,16 @@ class LLChatHistory : public LLTextEditor std::string mLastFromName; std::string mMessageHeaderFilename; std::string mMessageSeparatorFilename; + S32 mLeftTextPad; S32 mRightTextPad; + S32 mLeftWidgetPad; S32 mRightWidgetPad; + + S32 mTopSeparatorPad; + S32 mBottomSeparatorPad; + S32 mTopHeaderPad; + S32 mBottomHeaderPad; }; #endif /* LLCHATHISTORY_H_ */ diff --git a/indra/newview/skins/default/xui/en/panel_chat_header.xml b/indra/newview/skins/default/xui/en/panel_chat_header.xml index a9f622e018..64519b2571 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_header.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_header.xml @@ -1,53 +1,44 @@ - + - - - - + left="2" + mouse_opaque="true" + name="avatar_icon" + top="2" + width="16" /> + + diff --git a/indra/newview/skins/default/xui/en/panel_chat_separator.xml b/indra/newview/skins/default/xui/en/panel_chat_separator.xml index bacc750e86..d0a2ddb289 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_separator.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_separator.xml @@ -1,16 +1,8 @@ - - + name="chat_separator_panel" /> diff --git a/indra/newview/skins/default/xui/en/widgets/chat_history.xml b/indra/newview/skins/default/xui/en/widgets/chat_history.xml index ea6997ebd5..32916c0816 100644 --- a/indra/newview/skins/default/xui/en/widgets/chat_history.xml +++ b/indra/newview/skins/default/xui/en/widgets/chat_history.xml @@ -6,6 +6,10 @@ right_text_pad="15" left_widget_pad="0" right_widget_pad="10" + top_separator_pad="5" + bottom_separator_pad="5" + top_header_pad="17" + bottom_header_pad="10" max_length="2147483647" enabled="false" track_bottom="true" -- cgit v1.2.3