mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 10:23:02 +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; }
|
||||
|
||||
/// <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>
|
||||
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 =>
|
||||
{
|
||||
if (c is not ProgressNotification p || p.CompletedOrCancelled)
|
||||
if (c is not ProgressNotification p || !p.Ongoing)
|
||||
c.Close(true);
|
||||
});
|
||||
|
||||
|
@ -25,7 +25,10 @@ namespace osu.Game.Overlays.Notifications
|
||||
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user