Skip to content
Snippets Groups Projects
Commit d3773b99 authored by Seth ProductEngine's avatar Seth ProductEngine
Browse files

EXP-1506 FIXED starting the toast fade timer when a toast is overlapped by...

EXP-1506 FIXED starting the toast fade timer when a toast is overlapped by other floater like avatar inspector.
This is a kind of a workaround: perhaps the logic of updating the toast fade timer should be refactored to start/stop the timer from onMouseLeave/onMouseEnter callbacks instead of using "IsHovered" flag for each toast.
parent 8448f9d7
No related branches found
No related tags found
No related merge requests found
...@@ -419,25 +419,22 @@ void LLToast::onToastMouseLeave() ...@@ -419,25 +419,22 @@ void LLToast::onToastMouseLeave()
S32 x, y; S32 x, y;
LLUI::getMousePositionScreen(&x, &y); LLUI::getMousePositionScreen(&x, &y);
if( !panel_rc.pointInRect(x, y) && !button_rc.pointInRect(x, y)) mOnToastHoverSignal(this, MOUSE_LEAVE);
{
mOnToastHoverSignal(this, MOUSE_LEAVE);
updateTransparency(); updateTransparency();
//toasts fading is management by Screen Channel //toasts fading is management by Screen Channel
if(mHideBtn && mHideBtn->getEnabled()) if(mHideBtn && mHideBtn->getEnabled())
{
if( mHideBtnPressed )
{ {
if( mHideBtnPressed ) mHideBtnPressed = false;
{ return;
mHideBtnPressed = false;
return;
}
mHideBtn->setVisible(FALSE);
} }
mToastMouseLeaveSignal(this, getValue()); mHideBtn->setVisible(FALSE);
} }
mToastMouseLeaveSignal(this, getValue());
} }
void LLToast::setBackgroundOpaque(BOOL b) void LLToast::setBackgroundOpaque(BOOL b)
...@@ -499,7 +496,31 @@ bool LLToast::isHovered() ...@@ -499,7 +496,31 @@ bool LLToast::isHovered()
{ {
S32 x, y; S32 x, y;
LLUI::getMousePositionScreen(&x, &y); LLUI::getMousePositionScreen(&x, &y);
return mWrapperPanel->calcScreenRect().pointInRect(x, y);
if (!mWrapperPanel->calcScreenRect().pointInRect(x, y))
{
// mouse is not over this toast
return false;
}
bool is_overlapped_by_other_floater = false;
const child_list_t* child_list = gFloaterView->getChildList();
// find this toast in gFloaterView child list to check whether any floater
// with higher Z-order is visible under the mouse pointer overlapping this toast
child_list_const_reverse_iter_t r_iter = std::find(child_list->rbegin(), child_list->rend(), this);
if (r_iter != child_list->rend())
{
// skip this toast and proceed to views above in Z-order
for (++r_iter; r_iter != child_list->rend(); ++r_iter)
{
LLView* view = *r_iter;
is_overlapped_by_other_floater = view->isInVisibleChain() && view->calcScreenRect().pointInRect(x, y);
if (is_overlapped_by_other_floater) break;
}
}
return !is_overlapped_by_other_floater;
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment