summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lltoast.cpp23
-rw-r--r--indra/newview/lltoast.h9
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;
};
}