Automatically focus divisor textbox and hide popover after successful change

This commit is contained in:
Dean Herbert
2022-02-28 15:21:01 +09:00
parent a1786f62d7
commit 3634e12e66
2 changed files with 5 additions and 4 deletions

View File

@ -16,6 +16,7 @@ using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
@ -299,6 +300,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
base.LoadComplete();
BeatDivisor.BindValueChanged(_ => updateState(), true);
divisorTextBox.OnCommit += (_, __) => setPresets();
Schedule(() => GetContainingInputManager().ChangeFocus(divisorTextBox));
}
private void setPresets()
@ -320,6 +323,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
}
BeatDivisor.Value = divisor;
this.HidePopover();
}
private void updateState()