Skip to content
Snippets Groups Projects
Commit a8b5da9a authored by Vadim ProductEngine's avatar Vadim ProductEngine
Browse files

STORM-211 FIXED Only the hovered toasts now persists until you move mouse away...

STORM-211 FIXED Only the hovered toasts now persists until you move mouse away (all toasts used to freeze).
parent 7ea2a1f9
Branches
Tags
No related merge requests found
...@@ -253,8 +253,8 @@ void LLScreenChannel::addToast(const LLToast::Params& p) ...@@ -253,8 +253,8 @@ void LLScreenChannel::addToast(const LLToast::Params& p)
if(mControlHovering) if(mControlHovering)
{ {
new_toast_elem.toast->setOnToastHoverCallback(boost::bind(&LLScreenChannel::onToastHover, this, _1, _2)); 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->setMouseEnterCallback(boost::bind(&LLScreenChannel::stopFadingToast, this, new_toast_elem.toast));
new_toast_elem.toast->setMouseLeaveCallback(boost::bind(&LLScreenChannel::startFadingToasts, this)); new_toast_elem.toast->setMouseLeaveCallback(boost::bind(&LLScreenChannel::startFadingToast, this, new_toast_elem.toast));
} }
if(show_toast) if(show_toast)
...@@ -339,7 +339,6 @@ void LLScreenChannel::deleteToast(LLToast* toast) ...@@ -339,7 +339,6 @@ void LLScreenChannel::deleteToast(LLToast* toast)
if(mHoveredToast == toast) if(mHoveredToast == toast)
{ {
mHoveredToast = NULL; mHoveredToast = NULL;
startFadingToasts();
} }
// close the toast // close the toast
...@@ -698,38 +697,23 @@ void LLScreenChannel::closeStartUpToast() ...@@ -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; // Pause fade timer of the hovered toast.
toast->stopFading();
std::vector<ToastElem>::iterator it = mToastList.begin();
while (it != mToastList.end())
{
ToastElem& elem = *it;
elem.toast->stopFading();
++it;
}
} }
void LLNotificationsUI::LLScreenChannel::startFadingToasts() void LLNotificationsUI::LLScreenChannel::startFadingToast(LLToast* toast)
{ {
if (!mToastList.size()) return; if (!toast || toast == mHoveredToast)
//because onMouseLeave is processed after onMouseEnter
if (isHovering()) return;
std::vector<ToastElem>::iterator it = mToastList.begin();
while (it != mToastList.end())
{ {
ToastElem& elem = *it; return;
if (elem.toast->getVisible())
{
elem.toast->startFading();
}
++it;
} }
// Reset its fade timer.
toast->startFading();
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
......
...@@ -193,11 +193,11 @@ class LLScreenChannel : public LLScreenChannelBase ...@@ -193,11 +193,11 @@ class LLScreenChannel : public LLScreenChannelBase
void closeStartUpToast(); void closeStartUpToast();
/** Stop fading all toasts */ /** Stop fading given toast */
virtual void stopFadingToasts(); virtual void stopFadingToast(LLToast* toast);
/** Start fading all toasts */ /** Start fading given toast */
virtual void startFadingToasts(); virtual void startFadingToast(LLToast* toast);
// get StartUp Toast's state // get StartUp Toast's state
static bool getStartUpToastShown() { return mWasStartUpToastShown; } static bool getStartUpToastShown() { return mWasStartUpToastShown; }
......
...@@ -102,6 +102,7 @@ LLToast::LLToast(const LLToast::Params& p) ...@@ -102,6 +102,7 @@ LLToast::LLToast(const LLToast::Params& p)
if(!p.on_delete_toast().empty()) if(!p.on_delete_toast().empty())
mOnDeleteToastSignal.connect(p.on_delete_toast()); mOnDeleteToastSignal.connect(p.on_delete_toast());
// *TODO: This signal doesn't seem to be used at all.
if(!p.on_mouse_enter().empty()) if(!p.on_mouse_enter().empty())
mOnMouseEnterSignal.connect(p.on_mouse_enter()); mOnMouseEnterSignal.connect(p.on_mouse_enter());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment