mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09:00
Fix LabelledTextBox not correctly forwarding focus to its underlying TextBox component
This commit is contained in:
parent
eda891223c
commit
26d6f96c4e
@ -5,6 +5,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterfaceV2
|
namespace osu.Game.Graphics.UserInterfaceV2
|
||||||
@ -53,6 +54,14 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
|||||||
CornerRadius = CORNER_RADIUS,
|
CornerRadius = CORNER_RADIUS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public override bool AcceptsFocus => true;
|
||||||
|
|
||||||
|
protected override void OnFocus(FocusEvent e)
|
||||||
|
{
|
||||||
|
base.OnFocus(e);
|
||||||
|
GetContainingInputManager().ChangeFocus(Component);
|
||||||
|
}
|
||||||
|
|
||||||
protected override OsuTextBox CreateComponent() => CreateTextBox().With(t =>
|
protected override OsuTextBox CreateComponent() => CreateTextBox().With(t =>
|
||||||
{
|
{
|
||||||
t.OnCommit += (sender, newText) => OnCommit?.Invoke(sender, newText);
|
t.OnCommit += (sender, newText) => OnCommit?.Invoke(sender, newText);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user