summaryrefslogtreecommitdiff
path: root/indra/newview/llscreenchannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llscreenchannel.cpp')
-rw-r--r--indra/newview/llscreenchannel.cpp30
1 files changed, 11 insertions, 19 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 7c2e7e3319..a4426b370e 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -79,17 +79,12 @@ LLScreenChannelBase::~LLScreenChannelBase()
bool LLScreenChannelBase::isHovering()
{
- bool res = mHoveredToast != NULL;
- if (!res)
+ if (!mHoveredToast)
{
- return res;
+ return false;
}
- S32 x, y;
- mHoveredToast->screenPointToLocal(gViewerWindow->getCurrentMouseX(),
- gViewerWindow->getCurrentMouseY(), &x, &y);
- res = mHoveredToast->pointInView(x, y) == TRUE;
- return res;
+ return mHoveredToast->isHovered();
}
void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect)
@@ -479,7 +474,8 @@ void LLScreenChannel::showToastsBottom()
{
if(it != mToastList.rbegin())
{
- bottom = (*(it-1)).toast->getRect().mTop;
+ LLToast* toast = (*(it-1)).toast;
+ bottom = toast->getRect().mTop - toast->getTopPad();
toast_margin = gSavedSettings.getS32("ToastGap");
}
@@ -691,7 +687,10 @@ void LLNotificationsUI::LLScreenChannel::startFadingToasts()
while (it != mToastList.end())
{
ToastElem& elem = *it;
- elem.toast->startFading();
+ if (elem.toast->getVisible())
+ {
+ elem.toast->startFading();
+ }
++it;
}
}
@@ -777,23 +776,16 @@ void LLScreenChannel::onToastHover(LLToast* toast, bool 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)
{
- toast->screenPointToLocal(gViewerWindow->getCurrentMouseX(),
- gViewerWindow->getCurrentMouseY(), &x, &y);
- bool hover = toast->pointInView(x, y) == TRUE;
- if (hover)
+ if (toast->isHovered())
{
mHoveredToast = toast;
}
}
else if (mHoveredToast != NULL)
{
- mHoveredToast->screenPointToLocal(gViewerWindow->getCurrentMouseX(),
- gViewerWindow->getCurrentMouseY(), &x, &y);
- bool hover = mHoveredToast->pointInView(x, y) == TRUE;
- if (!hover)
+ if (!mHoveredToast->isHovered())
{
mHoveredToast = NULL;
}