1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-31 05:32:57 +08:00

Fix broken text boxes in editor

This commit is contained in:
Dean Herbert 2025-01-20 02:45:13 +09:00
parent e753e3ee2f
commit 0b9c41c94e
No known key found for this signature in database
3 changed files with 5 additions and 15 deletions

View File

@ -1,17 +1,17 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Input;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
public partial class OsuNumberBox : OsuTextBox public partial class OsuNumberBox : OsuTextBox
{ {
protected override bool AllowIme => false;
public OsuNumberBox() public OsuNumberBox()
{ {
InputProperties = new TextInputProperties(TextInputType.Number, false);
SelectAllOnFocus = true; SelectAllOnFocus = true;
} }
protected override bool CanAddCharacter(char character) => char.IsAsciiDigit(character);
} }
} }

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Globalization; using System.Globalization;
using osu.Framework.Input;
namespace osu.Game.Graphics.UserInterfaceV2 namespace osu.Game.Graphics.UserInterfaceV2
{ {
@ -20,11 +19,6 @@ namespace osu.Game.Graphics.UserInterfaceV2
{ {
public bool AllowDecimals { get; init; } public bool AllowDecimals { get; init; }
public InnerNumberBox()
{
InputProperties = new TextInputProperties(TextInputType.Number, false);
}
protected override bool CanAddCharacter(char character) protected override bool CanAddCharacter(char character)
=> char.IsAsciiDigit(character) || (AllowDecimals && CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator.Contains(character)); => char.IsAsciiDigit(character) || (AllowDecimals && CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator.Contains(character));
} }

View File

@ -5,7 +5,6 @@ using osu.Framework.Bindables;
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;
namespace osu.Game.Overlays.Settings namespace osu.Game.Overlays.Settings
{ {
@ -67,10 +66,7 @@ namespace osu.Game.Overlays.Settings
private partial class OutlinedNumberBox : OutlinedTextBox private partial class OutlinedNumberBox : OutlinedTextBox
{ {
public OutlinedNumberBox() protected override bool AllowIme => false;
{
InputProperties = new TextInputProperties(TextInputType.Number, false);
}
protected override bool CanAddCharacter(char character) => char.IsAsciiDigit(character); protected override bool CanAddCharacter(char character) => char.IsAsciiDigit(character);