diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2010-10-14 18:01:51 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2010-10-14 18:01:51 +0300 |
commit | a8b5da9a70936923e650bd5c200276da49106784 (patch) | |
tree | b65a226cde8882cf1bdb555daeea72ce41b05ce8 /indra/newview/llscreenchannel.cpp | |
parent | 7ea2a1f9cc998396f437ec2535ddb1d51cce46b1 (diff) |
STORM-211 FIXED Only the hovered toasts now persists until you move mouse away (all toasts used to freeze).
Diffstat (limited to 'indra/newview/llscreenchannel.cpp')
-rw-r--r-- | indra/newview/llscreenchannel.cpp | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 5c923a0409..18c9ac28c1 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -253,8 +253,8 @@ void LLScreenChannel::addToast(const LLToast::Params& p) if(mControlHovering) { new_toast_elem.toast->setOnToastHoverCallback(boost::bind(&LLScreenChannel::onToastHover, this, _1, _2)); - new_toast_elem.toast->setMouseEnterCallback(boost::bind(&LLScreenChannel::stopFadingToasts, this)); - new_toast_elem.toast->setMouseLeaveCallback(boost::bind(&LLScreenChannel::startFadingToasts, this)); + new_toast_elem.toast->setMouseEnterCallback(boost::bind(&LLScreenChannel::stopFadingToast, this, new_toast_elem.toast)); + new_toast_elem.toast->setMouseLeaveCallback(boost::bind(&LLScreenChannel::startFadingToast, this, new_toast_elem.toast)); } if(show_toast) @@ -339,7 +339,6 @@ void LLScreenChannel::deleteToast(LLToast* toast) if(mHoveredToast == toast) { mHoveredToast = NULL; - startFadingToasts(); } // close the toast @@ -698,38 +697,23 @@ void LLScreenChannel::closeStartUpToast() } } -void LLNotificationsUI::LLScreenChannel::stopFadingToasts() +void LLNotificationsUI::LLScreenChannel::stopFadingToast(LLToast* toast) { - if (!mToastList.size()) return; + if (!toast || toast != mHoveredToast) return; - if (!mHoveredToast) return; - - std::vector<ToastElem>::iterator it = mToastList.begin(); - while (it != mToastList.end()) - { - ToastElem& elem = *it; - elem.toast->stopFading(); - ++it; - } + // Pause fade timer of the hovered toast. + toast->stopFading(); } -void LLNotificationsUI::LLScreenChannel::startFadingToasts() +void LLNotificationsUI::LLScreenChannel::startFadingToast(LLToast* toast) { - if (!mToastList.size()) return; - - //because onMouseLeave is processed after onMouseEnter - if (isHovering()) return; - - std::vector<ToastElem>::iterator it = mToastList.begin(); - while (it != mToastList.end()) + if (!toast || toast == mHoveredToast) { - ToastElem& elem = *it; - if (elem.toast->getVisible()) - { - elem.toast->startFading(); - } - ++it; + return; } + + // Reset its fade timer. + toast->startFading(); } //-------------------------------------------------------------------------- |