mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
select all input text on popup for an easy typing experience
This commit is contained in:
parent
6aa92bcc45
commit
88314dc584
@ -78,7 +78,11 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
ScheduleAfterChildren(() => angleInput.TakeFocus());
|
||||
ScheduleAfterChildren(() =>
|
||||
{
|
||||
angleInput.TakeFocus();
|
||||
angleInput.SelectAll();
|
||||
});
|
||||
angleInput.Current.BindValueChanged(angle => rotationInfo.Value = rotationInfo.Value with { Degrees = angle.NewValue });
|
||||
rotationOrigin.Items.First().Select();
|
||||
|
||||
|
@ -80,7 +80,11 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
ScheduleAfterChildren(() => scaleInput.TakeFocus());
|
||||
ScheduleAfterChildren(() =>
|
||||
{
|
||||
scaleInput.TakeFocus();
|
||||
scaleInput.SelectAll();
|
||||
});
|
||||
scaleInput.Current.BindValueChanged(scale => scaleInfo.Value = scaleInfo.Value with { Scale = scale.NewValue });
|
||||
scaleOrigin.Items.First().Select();
|
||||
|
||||
|
@ -50,6 +50,8 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
||||
Component.BorderColour = colours.Blue;
|
||||
}
|
||||
|
||||
public bool SelectAll() => Component.SelectAll();
|
||||
|
||||
protected virtual OsuTextBox CreateTextBox() => new OsuTextBox();
|
||||
|
||||
public override bool AcceptsFocus => true;
|
||||
|
@ -87,6 +87,8 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
||||
|
||||
public bool TakeFocus() => GetContainingFocusManager().ChangeFocus(textBox);
|
||||
|
||||
public bool SelectAll() => textBox.SelectAll();
|
||||
|
||||
private bool updatingFromTextBox;
|
||||
|
||||
private void textChanged(ValueChangedEvent<string> change)
|
||||
|
Loading…
Reference in New Issue
Block a user