Remove necessity of AlwaysPresent for ProgressUpdate completion posting

This commit is contained in:
Dean Herbert 2022-09-05 18:57:33 +09:00
parent 0d4ee6bd80
commit f754686521
3 changed files with 10 additions and 12 deletions

View File

@ -71,7 +71,6 @@ namespace osu.Game.Overlays
},
mainContent = new Container
{
AlwaysPresent = true,
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
@ -137,9 +136,9 @@ namespace osu.Game.Overlays
private readonly Scheduler postScheduler = new Scheduler();
public override bool IsPresent => base.IsPresent
|| postScheduler.HasPendingTasks
|| toastTray.IsDisplayingToasts;
public override bool IsPresent =>
// Delegate presence as we need to consider the toast tray in addition to the main overlay.
State.Value == Visibility.Visible || mainContent.IsPresent || toastTray.IsPresent || postScheduler.HasPendingTasks;
private bool processingPosts = true;

View File

@ -70,7 +70,7 @@ namespace osu.Game.Overlays
postEffectDrawable.AutoSizeAxes = Axes.None;
postEffectDrawable.RelativeSizeAxes = Axes.X;
})),
toastFlow = new AlwaysUpdateFillFlowContainer<Notification>
toastFlow = new FillFlowContainer<Notification>
{
LayoutDuration = 150,
LayoutEasing = Easing.OutQuart,

View File

@ -88,7 +88,12 @@ namespace osu.Game.Overlays.Notifications
state = value;
if (IsLoaded)
{
Schedule(updateState);
if (state == ProgressNotificationState.Completed)
CompletionTarget?.Invoke(CreateCompletionNotification());
}
}
}
@ -141,7 +146,7 @@ namespace osu.Game.Overlays.Notifications
case ProgressNotificationState.Completed:
loadingSpinner.Hide();
Completed();
base.Close();
break;
}
}
@ -154,12 +159,6 @@ namespace osu.Game.Overlays.Notifications
Text = CompletionText
};
protected void Completed()
{
CompletionTarget?.Invoke(CreateCompletionNotification());
base.Close();
}
public override bool DisplayOnTop => false;
public override bool IsImportant => false;