From dcb786b5a477acd74ed7450a4975de0a7a1d66bd Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Tue, 8 Dec 2009 16:28:47 +0200 Subject: implemented normal task EXT-3086 Update non-interactive system toasts behavior --HG-- branch : product-engine --- indra/newview/lltoast.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'indra/newview/lltoast.cpp') diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index fc7c029a17..4131e2755a 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -67,7 +67,8 @@ LLToast::LLToast(const LLToast::Params& p) mHideBtn(NULL), mNotification(p.notification), mIsHidden(false), - mHideBtnPressed(false) + mHideBtnPressed(false), + mIsTip(p.is_tip) { LLUICtrlFactory::getInstance()->buildFloater(this, "panel_toast.xml", NULL); @@ -98,9 +99,29 @@ BOOL LLToast::postBuild() mTimer.stop(); } + if (mIsTip) + { + mTextEditor = mPanel->getChild("text_editor_box"); + + if (mTextEditor) + { + mTextEditor->setMouseUpCallback(boost::bind(&LLToast::hide,this)); + mPanel->setMouseUpCallback(boost::bind(&LLToast::handleTipToastClick, this, _2, _3, _4)); + } + } + return TRUE; } +//-------------------------------------------------------------------------- +void LLToast::handleTipToastClick(S32 x, S32 y, MASK mask) +{ + if (!mTextEditor->getRect().pointInRect(x, y)) + { + hide(); + } +} + //-------------------------------------------------------------------------- void LLToast::setHideButtonEnabled(bool enabled) { -- cgit v1.3