summaryrefslogtreecommitdiff
path: root/indra/newview/llscreenchannel.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-16 11:05:33 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-16 11:05:33 -0500
commit95cbf689f343ba4c0c352993273b5bb20812e36c (patch)
treedabc2ffc10bc027da8c60168e0190a0da98b5722 /indra/newview/llscreenchannel.cpp
parent59eb2815bfea9b0a826e006090d0fef80ae1f6b8 (diff)
parent6f52f1e502cf030ceb4e14963fdda1021ea33023 (diff)
merge
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llscreenchannel.cpp')
-rw-r--r--indra/newview/llscreenchannel.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index b667fbf5fd..81eb133b07 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -63,7 +63,7 @@ LLScreenChannelBase::LLScreenChannelBase(const LLUUID& id) :
,mCanStoreToasts(true)
,mHiddenToastsNum(0)
,mOverflowToastHidden(false)
- ,mIsHovering(false)
+ ,mHoveredToast(NULL)
,mControlHovering(false)
,mShowToasts(true)
{
@@ -216,8 +216,10 @@ void LLScreenChannel::deleteToast(LLToast* toast)
// update channel's Hovering state
// turning hovering off manually because onMouseLeave won't happen if a toast was closed using a keyboard
- if(toast->hasFocus())
- setHovering(false);
+ if(mHoveredToast == toast)
+ {
+ mHoveredToast = NULL;
+ }
// close the toast
toast->closeFloater();
@@ -352,7 +354,7 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel)
//--------------------------------------------------------------------------
void LLScreenChannel::redrawToasts()
{
- if(mToastList.size() == 0 || mIsHovering)
+ if(mToastList.size() == 0 || isHovering())
return;
hideToastsFromScreen();
@@ -453,10 +455,9 @@ void LLScreenChannel::createOverflowToast(S32 bottom, F32 timer)
if(!mOverflowToastPanel)
return;
- mOverflowToastPanel->setOnFadeCallback(boost::bind(&LLScreenChannel::closeOverflowToastPanel, this));
+ mOverflowToastPanel->setOnFadeCallback(boost::bind(&LLScreenChannel::onOverflowToastHide, this));
LLTextBox* text_box = mOverflowToastPanel->getChild<LLTextBox>("toast_text");
- LLIconCtrl* icon = mOverflowToastPanel->getChild<LLIconCtrl>("icon");
std::string text = llformat(mOverflowFormatString.c_str(),mHiddenToastsNum);
if(mHiddenToastsNum == 1)
{
@@ -474,7 +475,6 @@ void LLScreenChannel::createOverflowToast(S32 bottom, F32 timer)
text_box->setValue(text);
text_box->setVisible(TRUE);
- icon->setVisible(TRUE);
mOverflowToastPanel->setVisible(TRUE);
}
@@ -532,7 +532,6 @@ void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer)
mStartUpToastPanel->setOnFadeCallback(boost::bind(&LLScreenChannel::onStartUpToastHide, this));
LLTextBox* text_box = mStartUpToastPanel->getChild<LLTextBox>("toast_text");
- LLIconCtrl* icon = mStartUpToastPanel->getChild<LLIconCtrl>("icon");
std::string mStartUpFormatString;
@@ -555,8 +554,6 @@ void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer)
text_box->setValue(text);
text_box->setVisible(TRUE);
- icon->setVisible(TRUE);
-
addChild(mStartUpToastPanel);
mStartUpToastPanel->setVisible(TRUE);
@@ -654,7 +651,14 @@ void LLScreenChannel::onToastHover(LLToast* toast, bool mouse_enter)
// we must check this to prevent incorrect setting for hovering in a channel
std::map<LLToast*, bool>::iterator it_first, it_second;
S32 stack_size = mToastEventStack.size();
- mIsHovering = mouse_enter;
+ if(mouse_enter)
+ {
+ mHoveredToast = toast;
+ }
+ else
+ {
+ mHoveredToast = NULL;
+ }
switch(stack_size)
{
@@ -666,7 +670,7 @@ void LLScreenChannel::onToastHover(LLToast* toast, bool mouse_enter)
if((*it_first).second && !mouse_enter && ((*it_first).first != toast) )
{
mToastEventStack.clear();
- mIsHovering = true;
+ mHoveredToast = toast;
}
else
{
@@ -678,7 +682,7 @@ void LLScreenChannel::onToastHover(LLToast* toast, bool mouse_enter)
LL_ERRS ("LLScreenChannel::onToastHover: stack size error " ) << stack_size << llendl;
}
- if(!mIsHovering)
+ if(!isHovering())
redrawToasts();
}