mirror of https://github.com/ppy/osu
Merge pull request #3031 from peppy/make-notifications-quieter
Make notifications less noisy
This commit is contained in:
commit
f153f39596
|
@ -148,7 +148,7 @@ public void Download(BeatmapSetInfo beatmapSetInfo, bool noVideo = false)
|
|||
return;
|
||||
}
|
||||
|
||||
var downloadNotification = new ProgressNotification
|
||||
var downloadNotification = new DownloadNotification
|
||||
{
|
||||
CompletionText = $"Imported {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}!",
|
||||
Text = $"Downloading {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}",
|
||||
|
@ -460,5 +460,21 @@ public DummyConversionBeatmap(IBeatmap beatmap)
|
|||
protected override Texture GetBackground() => null;
|
||||
protected override Track GetTrack() => null;
|
||||
}
|
||||
|
||||
private class DownloadNotification : ProgressNotification
|
||||
{
|
||||
public override bool IsImportant => false;
|
||||
|
||||
protected override Notification CreateCompletionNotification() => new SilencedProgressCompletionNotification
|
||||
{
|
||||
Activated = CompletionClickAction,
|
||||
Text = CompletionText
|
||||
};
|
||||
|
||||
private class SilencedProgressCompletionNotification : ProgressCompletionNotification
|
||||
{
|
||||
public override bool IsImportant => false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,7 +128,8 @@ public void Post(Notification notification) => postScheduler.Add(() =>
|
|||
var section = sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => accept.IsAssignableFrom(ourType)));
|
||||
section?.Add(notification, notification.DisplayOnTop ? -runningDepth : runningDepth);
|
||||
|
||||
State = Visibility.Visible;
|
||||
if (notification.IsImportant)
|
||||
State = Visibility.Visible;
|
||||
|
||||
updateCounts();
|
||||
});
|
||||
|
|
|
@ -23,6 +23,11 @@ public abstract class Notification : Container
|
|||
/// </summary>
|
||||
public event Action Closed;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this notification should forcefully display itself.
|
||||
/// </summary>
|
||||
public virtual bool IsImportant => true;
|
||||
|
||||
/// <summary>
|
||||
/// Run on user activating the notification. Return true to close.
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue