mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Remove the necessity for NotificationOverlay to always be present
Now it will only become present when there is a pending notification.
This commit is contained in:
@ -35,8 +35,6 @@ namespace osu.Game.Overlays
|
||||
Width = width;
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
|
||||
AlwaysPresent = true;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
@ -100,9 +98,6 @@ namespace osu.Game.Overlays
|
||||
OverlayActivationMode.BindValueChanged(_ => updateProcessingMode(), true);
|
||||
}
|
||||
|
||||
private int totalCount => sections.Select(c => c.DisplayedCount).Sum();
|
||||
private int unreadCount => sections.Select(c => c.UnreadCount).Sum();
|
||||
|
||||
public readonly BindableInt UnreadCount = new BindableInt();
|
||||
|
||||
private int runningDepth;
|
||||
@ -111,6 +106,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
private readonly Scheduler postScheduler = new Scheduler();
|
||||
|
||||
public override bool IsPresent => base.IsPresent || postScheduler.HasPendingTasks;
|
||||
|
||||
private bool processingPosts = true;
|
||||
|
||||
public void Post(Notification notification) => postScheduler.Add(() =>
|
||||
@ -160,7 +157,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
private void updateCounts()
|
||||
{
|
||||
UnreadCount.Value = unreadCount;
|
||||
UnreadCount.Value = sections.Select(c => c.UnreadCount).Sum();
|
||||
}
|
||||
|
||||
private void markAllRead()
|
||||
|
Reference in New Issue
Block a user