Rename loading spinner bool to reflect that it has a setter

This commit is contained in:
Dean Herbert 2023-01-09 15:52:08 +09:00
parent d2f4ffcc5b
commit 13b00928c8
2 changed files with 14 additions and 14 deletions

View File

@ -120,9 +120,9 @@ namespace osu.Game.Tests.Visual.UserInterface
protected override void OnCommit(string value)
{
CommitButton.IsLoadingSpinnerShown = true;
CommitButton.ShowLoadingSpinner = true;
CommittedText = value;
Scheduler.AddDelayed(() => CommitButton.IsLoadingSpinnerShown = false, 1000);
Scheduler.AddDelayed(() => CommitButton.ShowLoadingSpinner = false, 1000);
}
protected override LocalisableString FooterText => @"Footer text. And it is pretty long. Cool.";

View File

@ -2,19 +2,19 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Graphics.Sprites;
using osuTK.Graphics;
using osu.Game.Graphics.UserInterface;
using osuTK;
using osu.Framework.Bindables;
using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterfaceV2;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.Comments
{
@ -159,17 +159,17 @@ namespace osu.Game.Overlays.Comments
public readonly BindableBool IsBlocked = new BindableBool();
private bool isLoadingSpinnerShown;
private bool showLoadingSpinner;
/// <summary>
/// Whether loading spinner shown.
/// </summary>
public bool IsLoadingSpinnerShown
public bool ShowLoadingSpinner
{
get => isLoadingSpinnerShown;
get => showLoadingSpinner;
set
{
isLoadingSpinnerShown = value;
showLoadingSpinner = value;
Enabled.Value = !value && !IsBlocked.Value;
spinner.FadeTo(value ? 1f : 0f, duration, Easing.OutQuint);
text.FadeTo(value ? 0f : 1f, duration, Easing.OutQuint);
@ -194,7 +194,7 @@ namespace osu.Game.Overlays.Comments
base.LoadComplete();
IsBlocked.BindValueChanged(e =>
{
Enabled.Value = !IsLoadingSpinnerShown && !e.NewValue;
Enabled.Value = !ShowLoadingSpinner && !e.NewValue;
}, true);
}