1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +08:00

Rename button spinner prop again

This commit is contained in:
ansel 2022-11-30 13:30:57 +03:00
parent f0922d34bb
commit a8422961dc
2 changed files with 10 additions and 10 deletions

View File

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

View File

@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Comments
/// <summary>
/// Whether editor is waiting for submit action to complete.
/// </summary>
public bool IsSubmitting => CommitButton.IsLoading;
public bool IsSubmitting => CommitButton.IsLoadingSpinnerShown;
protected abstract LocalisableString FooterText { get; }
@ -118,7 +118,7 @@ namespace osu.Game.Overlays.Comments
textBox.OnCommit += (_, _) =>
{
if (CommitButton.IsLoading)
if (CommitButton.IsLoadingSpinnerShown)
return;
CommitButton.TriggerClick();
@ -171,21 +171,21 @@ namespace osu.Game.Overlays.Comments
private const int duration = 200;
private readonly LoadingSpinner spinner;
private OsuSpriteText text = null!;
private readonly OsuSpriteText text = null!;
public readonly BindableBool IsBlocked = new BindableBool();
private bool isLoading;
private bool isLoadingSpinnerShown;
/// <summary>
/// Whether loading spinner shown.
/// </summary>
public bool IsLoading
public bool IsLoadingSpinnerShown
{
get => isLoading;
get => isLoadingSpinnerShown;
set
{
isLoading = value;
isLoadingSpinnerShown = value;
Enabled.Value = !value && !IsBlocked.Value;
spinner.FadeTo(value ? 1f : 0f, duration, Easing.OutQuint);
text.FadeTo(value ? 0f : 1f, duration, Easing.OutQuint);
@ -210,7 +210,7 @@ namespace osu.Game.Overlays.Comments
base.LoadComplete();
IsBlocked.BindValueChanged(e =>
{
Enabled.Value = !IsLoading && !e.NewValue;
Enabled.Value = !IsLoadingSpinnerShown && !e.NewValue;
}, true);
}
}