1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 01:45:35 +08:00

Merge pull request #9889 from peppy/editor-screen-loading-spinner

Add loading spinner while editor screen loads
This commit is contained in:
Dan Balasescu 2020-08-18 01:48:33 +09:00 committed by GitHub
commit 707912248a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Edit.Compose.Components; using osu.Game.Screens.Edit.Compose.Components;
using osu.Game.Screens.Edit.Compose.Components.Timeline; using osu.Game.Screens.Edit.Compose.Components.Timeline;
using osuTK.Graphics; using osuTK.Graphics;
@ -32,6 +33,8 @@ namespace osu.Game.Screens.Edit
Container mainContent; Container mainContent;
LoadingSpinner spinner;
Children = new Drawable[] Children = new Drawable[]
{ {
mainContent = new Container mainContent = new Container
@ -44,6 +47,10 @@ namespace osu.Game.Screens.Edit
Top = vertical_margins + timeline_height, Top = vertical_margins + timeline_height,
Bottom = vertical_margins Bottom = vertical_margins
}, },
Child = spinner = new LoadingSpinner(true)
{
State = { Value = Visibility.Visible },
},
}, },
new Container new Container
{ {
@ -87,9 +94,10 @@ namespace osu.Game.Screens.Edit
} }
}, },
}; };
LoadComponentAsync(CreateMainContent(), content => LoadComponentAsync(CreateMainContent(), content =>
{ {
spinner.State.Value = Visibility.Hidden;
mainContent.Add(content); mainContent.Add(content);
content.FadeInFromZero(300, Easing.OutQuint); content.FadeInFromZero(300, Easing.OutQuint);