mirror of
https://github.com/ppy/osu
synced 2024-12-16 11:56:31 +00:00
Fix notification toast tray potentially hiding some notifications
This commit is contained in:
parent
8ca8648a09
commit
846fd73ac9
@ -24,16 +24,16 @@ namespace osu.Game.Overlays
|
||||
/// </summary>
|
||||
public partial class NotificationOverlayToastTray : CompositeDrawable
|
||||
{
|
||||
public override bool IsPresent => toastContentBackground.Height > 0 || toastFlow.Count > 0;
|
||||
public override bool IsPresent => toastContentBackground.Height > 0 || Notifications.Any();
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => toastFlow.ReceivePositionalInputAt(screenSpacePos);
|
||||
|
||||
/// <summary>
|
||||
/// All notifications currently being displayed by the toast tray.
|
||||
/// </summary>
|
||||
public IEnumerable<Notification> Notifications => toastFlow;
|
||||
public IEnumerable<Notification> Notifications => toastFlow.Concat(InternalChildren.OfType<Notification>());
|
||||
|
||||
public bool IsDisplayingToasts => toastFlow.Count > 0;
|
||||
public bool IsDisplayingToasts => Notifications.Any();
|
||||
|
||||
private FillFlowContainer<Notification> toastFlow = null!;
|
||||
private BufferedContainer toastContentBackground = null!;
|
||||
@ -43,12 +43,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
public Action<Notification>? ForwardNotificationToPermanentStore { get; set; }
|
||||
|
||||
public int UnreadCount => allDisplayedNotifications.Count(n => !n.WasClosed && !n.Read);
|
||||
|
||||
/// <summary>
|
||||
/// Notifications contained in the toast flow, or in a detached state while they animate during forwarding to the main overlay.
|
||||
/// </summary>
|
||||
private IEnumerable<Notification> allDisplayedNotifications => toastFlow.Concat(InternalChildren.OfType<Notification>());
|
||||
public int UnreadCount => Notifications.Count(n => !n.WasClosed && !n.Read);
|
||||
|
||||
private int runningDepth;
|
||||
|
||||
@ -91,11 +86,7 @@ namespace osu.Game.Overlays
|
||||
};
|
||||
}
|
||||
|
||||
public void MarkAllRead()
|
||||
{
|
||||
toastFlow.Children.ForEach(n => n.Read = true);
|
||||
InternalChildren.OfType<Notification>().ForEach(n => n.Read = true);
|
||||
}
|
||||
public void MarkAllRead() => Notifications.ForEach(n => n.Read = true);
|
||||
|
||||
public void FlushAllToasts()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user