Skip to content

Commit

Permalink
Add support for focusing intermediate slider-textbox component
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzibyte committed May 11, 2022
1 parent f797514 commit 24432df
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Overlays.Settings;
Expand Down Expand Up @@ -107,6 +108,14 @@ public IndeterminateSliderWithTextBoxInput(LocalisableString labelText, Bindable
Current.BindValueChanged(_ => updateState(), true);
}

public override bool AcceptsFocus => true;

protected override void OnFocus(FocusEvent e)
{
base.OnFocus(e);
GetContainingInputManager().ChangeFocus(textBox);
}

private void updateState()
{
if (Current.Value is T nonNullValue)
Expand Down

0 comments on commit 24432df

Please sign in to comment.