diff --git a/osu.Game/Overlays/Notifications/Notification.cs b/osu.Game/Overlays/Notifications/Notification.cs index a590507f41..49b2823531 100644 --- a/osu.Game/Overlays/Notifications/Notification.cs +++ b/osu.Game/Overlays/Notifications/Notification.cs @@ -63,6 +63,8 @@ protected Notification() Masking = true, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, + AutoSizeDuration = 400, + AutoSizeEasing = Easing.OutQuint, Children = new Drawable[] { new Box @@ -74,7 +76,7 @@ protected Notification() { RelativeSizeAxes = Axes.X, Padding = new MarginPadding(5), - Height = 60, + AutoSizeAxes = Axes.Y, Children = new Drawable[] { IconContent = new Container diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs index 98aac3a02d..f42b4b6cb3 100644 --- a/osu.Game/Overlays/Notifications/ProgressNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs @@ -6,9 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; @@ -18,10 +16,9 @@ public class ProgressNotification : Notification, IHasCompletionTarget { public string Text { - get { return textDrawable.Text; } set { - textDrawable.Text = value; + Schedule(() => textDrawable.Text = value); } } @@ -90,7 +87,7 @@ public virtual ProgressNotificationState State protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification { Activated = CompletionClickAction, - Text = $"Task \"{Text}\" has completed!" + Text = "Task has completed!" }; protected virtual void Completed() @@ -106,7 +103,7 @@ protected virtual void Completed() private Color4 colourActive; private Color4 colourCancelled; - private readonly SpriteText textDrawable; + private readonly TextFlowContainer textDrawable; public ProgressNotification() { @@ -115,9 +112,11 @@ public ProgressNotification() RelativeSizeAxes = Axes.Both, }); - Content.Add(textDrawable = new OsuSpriteText + Content.Add(textDrawable = new TextFlowContainer(t => + { + t.TextSize = 16; + }) { - TextSize = 16, Colour = OsuColour.Gray(128), AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, @@ -131,6 +130,9 @@ public ProgressNotification() }); State = ProgressNotificationState.Queued; + + // don't close on click by default. + Activated = () => false; } [BackgroundDependencyLoader] @@ -167,7 +169,7 @@ public override void Close() private class ProgressBar : Container { - private Box box; + private readonly Box box; private Color4 colourActive; private Color4 colourInactive; @@ -197,15 +199,8 @@ public bool Active } } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) + public ProgressBar() { - colourActive = colours.Blue; - Colour = colourInactive = OsuColour.Gray(0.5f); - - Height = 5; - Children = new[] { box = new Box @@ -215,6 +210,15 @@ private void load(OsuColour colours) } }; } + + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + colourActive = colours.Blue; + Colour = colourInactive = OsuColour.Gray(0.5f); + Height = 5; + } } }