From 5e63efe1da6b72fc0ce9771b9ef1e5c9d9bcb537 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Wed, 3 Feb 2010 11:38:03 +0200 Subject: =?UTF-8?q?fixed=20EXT-4805=20=E2=80=9CFriend=20offer=20is=20corru?= =?UTF-8?q?pted=20in=20resized=20IM=20window=E2=80=9D,=20reverted=20IM=20f?= =?UTF-8?q?loater=20default=20width;=20made=20offer=20buttons=20have=20abs?= =?UTF-8?q?olute=20positions;=20avoided=20text=20message=20scrolling=20wit?= =?UTF-8?q?h=20default=20IM=20floater=20width;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 581c210bd5..64226ac52b 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -55,6 +55,7 @@ #include "lltoastnotifypanel.h" #include "llviewerregion.h" #include "llworld.h" +#include "lluiconstants.h" #include "llsidetray.h"//for blocked objects panel @@ -664,8 +665,36 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL { LLToastNotifyPanel* notify_box = new LLToastNotifyPanel( notification); + //we can't set follows in xml since it broke toasts behavior notify_box->setFollowsLeft(); notify_box->setFollowsRight(); + notify_box->setFollowsTop(); + + LLButton* accept_button = notify_box->getChild ("Accept", + TRUE); + if (accept_button != NULL) + { + accept_button->setFollowsNone(); + accept_button->setOrigin(2*HPAD, accept_button->getRect().mBottom); + } + + LLButton* decline_button = notify_box->getChild ( + "Decline", TRUE); + if (accept_button != NULL && decline_button != NULL) + { + decline_button->setFollowsNone(); + decline_button->setOrigin(4*HPAD + + accept_button->getRect().getWidth(), + decline_button->getRect().mBottom); + } + + LLTextEditor* text_editor = notify_box->getChild("text_editor_box", TRUE); + S32 text_heigth = 0; + if(text_editor != NULL) + { + text_heigth = text_editor->getTextBoundingRect().getHeight(); + } + //Prepare the rect for the view LLRect target_rect = mEditor->getDocumentView()->getRect(); // squeeze down the widget by subtracting padding off left and right @@ -675,6 +704,15 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL notify_box->getRect().getHeight()); notify_box->setOrigin(target_rect.mLeft, notify_box->getRect().mBottom); + if (text_editor != NULL) + { + S32 text_heigth_delta = + text_editor->getTextBoundingRect().getHeight() + - text_heigth; + notify_box->reshape(target_rect.getWidth(), + notify_box->getRect().getHeight() + text_heigth_delta); + } + LLInlineViewSegment::Params params; params.view = notify_box; params.left_pad = mLeftWidgetPad; -- cgit v1.2.3 From cb03e6f92a5d89056ef83e97fe436a165bb3ae78 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Wed, 3 Feb 2010 16:25:32 +0200 Subject: fixed EXT-4776 Make avatars in nearby chat inspectable --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 64226ac52b..a351c52ce2 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -53,7 +53,9 @@ #include "llagent.h" #include "llnotificationsutil.h" #include "lltoastnotifypanel.h" +#include "lltooltip.h" #include "llviewerregion.h" +#include "llviewertexteditor.h" #include "llworld.h" #include "lluiconstants.h" @@ -111,6 +113,34 @@ public: return LLPanel::handleMouseUp(x,y,mask); } + //*TODO remake it using mouse enter/leave and static LLHandle to add/remove as a child + BOOL handleToolTip(S32 x, S32 y, MASK mask) + { + LLViewerTextEditor* name = getChild("user_name"); + if (name && name->parentPointInView(x, y) && mAvatarID.notNull() && SYSTEM_FROM != mFrom) + { + + // Spawn at right side of the name textbox. + LLRect sticky_rect = name->calcScreenRect(); + S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3); + + LLToolTip::Params params; + params.background_visible(false); + params.click_callback(boost::bind(&LLChatHistoryHeader::onHeaderPanelClick, this, 0, 0, 0)); + params.delay_time(0.0f); // spawn instantly on hover + params.image(LLUI::getUIImage("Info_Small")); + params.message(""); + params.padding(0); + params.pos(LLCoordGL(icon_x, sticky_rect.mTop - 2)); + params.sticky_rect(sticky_rect); + + LLToolTipMgr::getInstance()->show(params); + return TRUE; + } + + return LLPanel::handleToolTip(x, y, mask); + } + void onObjectIconContextMenuItemClicked(const LLSD& userdata) { std::string level = userdata.asString(); -- cgit v1.2.3