summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAlexei Arabadji <aarabadji@productengine.com>2009-12-08 20:35:07 +0200
committerAlexei Arabadji <aarabadji@productengine.com>2009-12-08 20:35:07 +0200
commitabe3084db2487eb14e1b99b6a58d42f2829e3845 (patch)
treea260bbe9f7a43685423b3919a8c323dbcc9a61c8 /indra
parent09f0b98e14a167902ffea75467e8c528cab8dad8 (diff)
parent7d261eb9cf95efdeb546fe8b39568015d840c61a (diff)
Automated merge with https://hg.aws.productengine.com/secondlife/viewer-2-0/
--HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llscreenchannel.cpp44
-rw-r--r--indra/newview/llscreenchannel.h1
2 files changed, 17 insertions, 28 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 64f57f24f9..222b462d1a 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -243,6 +243,7 @@ void LLScreenChannel::deleteToast(LLToast* toast)
if(mHoveredToast == toast)
{
mHoveredToast = NULL;
+ startFadingToasts();
}
// close the toast
@@ -720,39 +721,28 @@ void LLScreenChannel::removeToastsBySessionID(LLUUID id)
//--------------------------------------------------------------------------
void LLScreenChannel::onToastHover(LLToast* toast, bool mouse_enter)
{
- // because of LLViewerWindow::updateUI() that ALWAYS calls onMouseEnter BEFORE onMouseLeave
- // 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();
- if(mouse_enter)
+ // because of LLViewerWindow::updateUI() that NOT ALWAYS calls onMouseEnter BEFORE onMouseLeave
+ // we must check hovering directly to prevent incorrect setting for hovering in a channel
+ S32 x,y;
+ if (mouse_enter)
{
- mHoveredToast = toast;
- }
- else
- {
- mHoveredToast = NULL;
- }
-
- switch(stack_size)
- {
- case 0:
- mToastEventStack.insert(std::pair<LLToast*, bool>(toast, mouse_enter));
- break;
- case 1:
- it_first = mToastEventStack.begin();
- if((*it_first).second && !mouse_enter && ((*it_first).first != toast) )
+ toast->screenPointToLocal(gViewerWindow->getCurrentMouseX(),
+ gViewerWindow->getCurrentMouseY(), &x, &y);
+ bool hover = toast->pointInView(x, y) == TRUE;
+ if (hover)
{
- mToastEventStack.clear();
mHoveredToast = toast;
}
- else
+ }
+ else if (mHoveredToast != NULL)
+ {
+ mHoveredToast->screenPointToLocal(gViewerWindow->getCurrentMouseX(),
+ gViewerWindow->getCurrentMouseY(), &x, &y);
+ bool hover = mHoveredToast->pointInView(x, y) == TRUE;
+ if (!hover)
{
- mToastEventStack.clear();
- mToastEventStack.insert(std::pair<LLToast*, bool>(toast, mouse_enter));
+ mHoveredToast = NULL;
}
- break;
- default:
- LL_ERRS ("LLScreenChannel::onToastHover: stack size error " ) << stack_size << llendl;
}
if(!isHovering())
diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h
index 3b0ee2050c..b551732133 100644
--- a/indra/newview/llscreenchannel.h
+++ b/indra/newview/llscreenchannel.h
@@ -279,7 +279,6 @@ private:
std::vector<ToastElem> mToastList;
std::vector<ToastElem> mStoredToastList;
- std::map<LLToast*, bool> mToastEventStack;
};
}