mirror of https://github.com/ppy/osu
Don't dismiss toasts while hovered (and adjust timings slightly)
This commit is contained in:
parent
403fc18976
commit
224ab29ef4
|
@ -90,12 +90,20 @@ public void Post(Notification notification, Action addPermanently)
|
||||||
|
|
||||||
toastFlow.Insert(depth, notification);
|
toastFlow.Insert(depth, notification);
|
||||||
|
|
||||||
pendingToastOperations.Add(Scheduler.AddDelayed(() =>
|
pendingToastOperations.Add(scheduleDismissal());
|
||||||
|
|
||||||
|
ScheduledDelegate scheduleDismissal() => Scheduler.AddDelayed(() =>
|
||||||
{
|
{
|
||||||
// add notification to permanent overlay unless it was already dismissed by the user.
|
// add notification to permanent overlay unless it was already dismissed by the user.
|
||||||
if (notification.WasClosed)
|
if (notification.WasClosed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (notification.IsHovered)
|
||||||
|
{
|
||||||
|
pendingToastOperations.Add(scheduleDismissal());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
toastFlow.Remove(notification);
|
toastFlow.Remove(notification);
|
||||||
AddInternal(notification);
|
AddInternal(notification);
|
||||||
|
|
||||||
|
@ -107,7 +115,7 @@ public void Post(Notification notification, Action addPermanently)
|
||||||
|
|
||||||
notification.FadeIn(300, Easing.OutQuint);
|
notification.FadeIn(300, Easing.OutQuint);
|
||||||
});
|
});
|
||||||
}, notification.IsImportant ? 15000 : 3000));
|
}, notification.IsImportant ? 12000 : 2500);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
|
Loading…
Reference in New Issue