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();
|
base.LoadComplete();
|
||||||
|
|
||||||
ScheduleAfterChildren(() => angleInput.TakeFocus());
|
ScheduleAfterChildren(() =>
|
||||||
|
{
|
||||||
|
angleInput.TakeFocus();
|
||||||
|
angleInput.SelectAll();
|
||||||
|
});
|
||||||
angleInput.Current.BindValueChanged(angle => rotationInfo.Value = rotationInfo.Value with { Degrees = angle.NewValue });
|
angleInput.Current.BindValueChanged(angle => rotationInfo.Value = rotationInfo.Value with { Degrees = angle.NewValue });
|
||||||
rotationOrigin.Items.First().Select();
|
rotationOrigin.Items.First().Select();
|
||||||
|
|
||||||
|
@ -80,7 +80,11 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
ScheduleAfterChildren(() => scaleInput.TakeFocus());
|
ScheduleAfterChildren(() =>
|
||||||
|
{
|
||||||
|
scaleInput.TakeFocus();
|
||||||
|
scaleInput.SelectAll();
|
||||||
|
});
|
||||||
scaleInput.Current.BindValueChanged(scale => scaleInfo.Value = scaleInfo.Value with { Scale = scale.NewValue });
|
scaleInput.Current.BindValueChanged(scale => scaleInfo.Value = scaleInfo.Value with { Scale = scale.NewValue });
|
||||||
scaleOrigin.Items.First().Select();
|
scaleOrigin.Items.First().Select();
|
||||||
|
|
||||||
|
@ -50,6 +50,8 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
|||||||
Component.BorderColour = colours.Blue;
|
Component.BorderColour = colours.Blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool SelectAll() => Component.SelectAll();
|
||||||
|
|
||||||
protected virtual OsuTextBox CreateTextBox() => new OsuTextBox();
|
protected virtual OsuTextBox CreateTextBox() => new OsuTextBox();
|
||||||
|
|
||||||
public override bool AcceptsFocus => true;
|
public override bool AcceptsFocus => true;
|
||||||
|
@ -87,6 +87,8 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
|||||||
|
|
||||||
public bool TakeFocus() => GetContainingFocusManager().ChangeFocus(textBox);
|
public bool TakeFocus() => GetContainingFocusManager().ChangeFocus(textBox);
|
||||||
|
|
||||||
|
public bool SelectAll() => textBox.SelectAll();
|
||||||
|
|
||||||
private bool updatingFromTextBox;
|
private bool updatingFromTextBox;
|
||||||
|
|
||||||
private void textChanged(ValueChangedEvent<string> change)
|
private void textChanged(ValueChangedEvent<string> change)
|
||||||
|
Loading…
Reference in New Issue
Block a user