mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Flip and rename CompletedOrCancelled
to Ongoing
This commit is contained in:
parent
3a9b259f8a
commit
cdaf8e4b0f
@ -42,8 +42,8 @@ namespace osu.Game.Overlays
|
|||||||
IEnumerable<Notification> AllNotifications { get; }
|
IEnumerable<Notification> AllNotifications { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// All ongoing operations (ie. any <see cref="ProgressNotification"/> not in a completed state).
|
/// All ongoing operations (ie. any <see cref="ProgressNotification"/> not in a completed or cancelled state).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<ProgressNotification> OngoingOperations => AllNotifications.OfType<ProgressNotification>().Where(p => !p.CompletedOrCancelled);
|
public IEnumerable<ProgressNotification> OngoingOperations => AllNotifications.OfType<ProgressNotification>().Where(p => p.Ongoing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
private void clearAll() => notifications.Children.ForEach(c =>
|
private void clearAll() => notifications.Children.ForEach(c =>
|
||||||
{
|
{
|
||||||
if (c is not ProgressNotification p || p.CompletedOrCancelled)
|
if (c is not ProgressNotification p || !p.Ongoing)
|
||||||
c.Close(true);
|
c.Close(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -25,7 +25,10 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public Func<bool>? CancelRequested { get; set; }
|
public Func<bool>? CancelRequested { get; set; }
|
||||||
|
|
||||||
public bool CompletedOrCancelled => State == ProgressNotificationState.Completed || State == ProgressNotificationState.Cancelled;
|
/// <summary>
|
||||||
|
/// Whether the operation represented by the <see cref="ProgressNotification"/> is still ongoing.
|
||||||
|
/// </summary>
|
||||||
|
public bool Ongoing => State != ProgressNotificationState.Completed && State != ProgressNotificationState.Cancelled;
|
||||||
|
|
||||||
protected override bool AllowFlingDismiss => false;
|
protected override bool AllowFlingDismiss => false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user