diff options
author | Andrew Polunin <apolunin@productengine.com> | 2009-12-08 16:28:47 +0200 |
---|---|---|
committer | Andrew Polunin <apolunin@productengine.com> | 2009-12-08 16:28:47 +0200 |
commit | dcb786b5a477acd74ed7450a4975de0a7a1d66bd (patch) | |
tree | 525a87df39afdcf0bb5c04ba64d517c2812003a8 /indra/newview | |
parent | 8bfdaebc8072b89ce1268345b0c1a471a4194edf (diff) |
implemented normal task EXT-3086 Update non-interactive system toasts behavior
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lltoast.cpp | 23 | ||||
-rw-r--r-- | indra/newview/lltoast.h | 9 |
2 files changed, 29 insertions, 3 deletions
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,10 +99,30 @@ BOOL LLToast::postBuild() mTimer.stop(); } + if (mIsTip) + { + mTextEditor = mPanel->getChild<LLTextEditor>("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) { if(mHideBtn) diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index d08e46e160..0c3c598704 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -40,6 +40,7 @@ #include "llnotificationptr.h" #include "llviewercontrol.h" +#include "lltexteditor.h" #define MOUSE_LEAVE false #define MOUSE_ENTER true @@ -155,6 +156,8 @@ public: private: + void handleTipToastClick(S32 x, S32 y, MASK mask); + // check timer bool lifetimeHasExpired(); // on timer finished function @@ -169,8 +172,9 @@ private: F32 mToastLifetime; // in seconds F32 mToastFadingTime; // in seconds - LLPanel* mPanel; - LLButton* mHideBtn; + LLPanel* mPanel; + LLButton* mHideBtn; + LLTextEditor* mTextEditor; LLColor4 mBgColor; bool mCanFade; @@ -178,6 +182,7 @@ private: bool mHideBtnEnabled; bool mHideBtnPressed; bool mIsHidden; // this flag is TRUE when a toast has faded or was hidden with (x) button (EXT-1849) + bool mIsTip; }; } |