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

Always select text when an editor slider-textbox is focused

This commit is contained in:
Dean Herbert 2025-01-20 16:17:39 +09:00
parent ebca2e4b4f
commit dcdb8d13a9
No known key found for this signature in database
4 changed files with 4 additions and 17 deletions

View File

@ -85,11 +85,7 @@ namespace osu.Game.Rulesets.Osu.Edit
{
base.LoadComplete();
ScheduleAfterChildren(() =>
{
xInput.TakeFocus();
xInput.SelectAll();
});
ScheduleAfterChildren(() => xInput.TakeFocus());
}
protected override void PopIn()

View File

@ -96,11 +96,7 @@ namespace osu.Game.Rulesets.Osu.Edit
{
base.LoadComplete();
ScheduleAfterChildren(() =>
{
angleInput.TakeFocus();
angleInput.SelectAll();
});
ScheduleAfterChildren(() => angleInput.TakeFocus());
angleInput.Current.BindValueChanged(angle => rotationInfo.Value = rotationInfo.Value with { Degrees = angle.NewValue });
rotationHandler.CanRotateAroundSelectionOrigin.BindValueChanged(e =>

View File

@ -139,11 +139,7 @@ namespace osu.Game.Rulesets.Osu.Edit
{
base.LoadComplete();
ScheduleAfterChildren(() =>
{
scaleInput.TakeFocus();
scaleInput.SelectAll();
});
ScheduleAfterChildren(() => scaleInput.TakeFocus());
scaleInput.Current.BindValueChanged(scale => scaleInfo.Value = scaleInfo.Value with { Scale = scale.NewValue });
xCheckBox.Current.BindValueChanged(_ =>

View File

@ -74,6 +74,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
textBox = new LabelledTextBox
{
Label = labelText,
SelectAllOnFocus = true,
},
slider = new SettingsSlider<T>
{
@ -92,8 +93,6 @@ namespace osu.Game.Graphics.UserInterfaceV2
public bool TakeFocus() => GetContainingFocusManager()?.ChangeFocus(textBox) == true;
public bool SelectAll() => textBox.SelectAll();
private bool updatingFromTextBox;
private void textChanged(ValueChangedEvent<string> change)