1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 18:23:21 +08:00

Merge pull request #23823 from peppy/beat-divisor-select-text-on-click

Select text in beat divisor popover automatically
This commit is contained in:
Bartłomiej Dach 2023-10-31 09:34:44 +01:00 committed by GitHub
commit 84fb0c63e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -321,7 +321,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
Spacing = new Vector2(10),
Children = new Drawable[]
{
divisorTextBox = new OsuNumberBox
divisorTextBox = new AutoSelectTextBox
{
RelativeSizeAxes = Axes.X,
PlaceholderText = "Beat divisor"
@ -341,8 +341,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
base.LoadComplete();
BeatDivisor.BindValueChanged(_ => updateState(), true);
divisorTextBox.OnCommit += (_, _) => setPresetsFromTextBoxEntry();
Schedule(() => GetContainingInputManager().ChangeFocus(divisorTextBox));
}
private void setPresetsFromTextBoxEntry()
@ -590,5 +588,16 @@ namespace osu.Game.Screens.Edit.Compose.Components
}
}
}
private partial class AutoSelectTextBox : OsuNumberBox
{
protected override void LoadComplete()
{
base.LoadComplete();
GetContainingInputManager().ChangeFocus(this);
SelectAll();
}
}
}
}