mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 08:13:15 +08:00
Update autoselect implementation to work correctly with framework changes
This commit is contained in:
parent
8a68333425
commit
144006fbe8
@ -321,7 +321,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
Spacing = new Vector2(10),
|
Spacing = new Vector2(10),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
divisorTextBox = new OsuNumberBox
|
divisorTextBox = new AutoSelectTextBox
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
PlaceholderText = "Beat divisor"
|
PlaceholderText = "Beat divisor"
|
||||||
@ -341,8 +341,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
BeatDivisor.BindValueChanged(_ => updateState(), true);
|
BeatDivisor.BindValueChanged(_ => updateState(), true);
|
||||||
divisorTextBox.OnCommit += (_, _) => setPresetsFromTextBoxEntry();
|
divisorTextBox.OnCommit += (_, _) => setPresetsFromTextBoxEntry();
|
||||||
|
|
||||||
divisorTextBox.SelectAll();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPresetsFromTextBoxEntry()
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user