mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:52:54 +08:00
Rename button spinner prop again
This commit is contained in:
parent
f0922d34bb
commit
a8422961dc
@ -116,9 +116,9 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
private void onCommit(string value)
|
private void onCommit(string value)
|
||||||
{
|
{
|
||||||
CommitButton.IsLoading = true;
|
CommitButton.IsLoadingSpinnerShown = true;
|
||||||
CommittedText = value;
|
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.";
|
protected override LocalisableString FooterText => @"Footer text. And it is pretty long. Cool.";
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether editor is waiting for submit action to complete.
|
/// Whether editor is waiting for submit action to complete.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSubmitting => CommitButton.IsLoading;
|
public bool IsSubmitting => CommitButton.IsLoadingSpinnerShown;
|
||||||
|
|
||||||
protected abstract LocalisableString FooterText { get; }
|
protected abstract LocalisableString FooterText { get; }
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
|
|
||||||
textBox.OnCommit += (_, _) =>
|
textBox.OnCommit += (_, _) =>
|
||||||
{
|
{
|
||||||
if (CommitButton.IsLoading)
|
if (CommitButton.IsLoadingSpinnerShown)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CommitButton.TriggerClick();
|
CommitButton.TriggerClick();
|
||||||
@ -171,21 +171,21 @@ namespace osu.Game.Overlays.Comments
|
|||||||
private const int duration = 200;
|
private const int duration = 200;
|
||||||
|
|
||||||
private readonly LoadingSpinner spinner;
|
private readonly LoadingSpinner spinner;
|
||||||
private OsuSpriteText text = null!;
|
private readonly OsuSpriteText text = null!;
|
||||||
|
|
||||||
public readonly BindableBool IsBlocked = new BindableBool();
|
public readonly BindableBool IsBlocked = new BindableBool();
|
||||||
|
|
||||||
private bool isLoading;
|
private bool isLoadingSpinnerShown;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether loading spinner shown.
|
/// Whether loading spinner shown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsLoading
|
public bool IsLoadingSpinnerShown
|
||||||
{
|
{
|
||||||
get => isLoading;
|
get => isLoadingSpinnerShown;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
isLoading = value;
|
isLoadingSpinnerShown = value;
|
||||||
Enabled.Value = !value && !IsBlocked.Value;
|
Enabled.Value = !value && !IsBlocked.Value;
|
||||||
spinner.FadeTo(value ? 1f : 0f, duration, Easing.OutQuint);
|
spinner.FadeTo(value ? 1f : 0f, duration, Easing.OutQuint);
|
||||||
text.FadeTo(value ? 0f : 1f, duration, Easing.OutQuint);
|
text.FadeTo(value ? 0f : 1f, duration, Easing.OutQuint);
|
||||||
@ -210,7 +210,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
IsBlocked.BindValueChanged(e =>
|
IsBlocked.BindValueChanged(e =>
|
||||||
{
|
{
|
||||||
Enabled.Value = !IsLoading && !e.NewValue;
|
Enabled.Value = !IsLoadingSpinnerShown && !e.NewValue;
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user