mirror of
https://github.com/ppy/osu.git
synced 2025-01-31 04:32:57 +08:00
Fix broken text boxes in editor
This commit is contained in:
parent
e753e3ee2f
commit
0b9c41c94e
@ -1,17 +1,17 @@
|
||||
// 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.
|
||||
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public partial class OsuNumberBox : OsuTextBox
|
||||
{
|
||||
protected override bool AllowIme => false;
|
||||
|
||||
public OsuNumberBox()
|
||||
{
|
||||
InputProperties = new TextInputProperties(TextInputType.Number, false);
|
||||
|
||||
SelectAllOnFocus = true;
|
||||
}
|
||||
|
||||
protected override bool CanAddCharacter(char character) => char.IsAsciiDigit(character);
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Globalization;
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterfaceV2
|
||||
{
|
||||
@ -20,11 +19,6 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
||||
{
|
||||
public bool AllowDecimals { get; init; }
|
||||
|
||||
public InnerNumberBox()
|
||||
{
|
||||
InputProperties = new TextInputProperties(TextInputType.Number, false);
|
||||
}
|
||||
|
||||
protected override bool CanAddCharacter(char character)
|
||||
=> char.IsAsciiDigit(character) || (AllowDecimals && CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator.Contains(character));
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
@ -67,10 +66,7 @@ namespace osu.Game.Overlays.Settings
|
||||
|
||||
private partial class OutlinedNumberBox : OutlinedTextBox
|
||||
{
|
||||
public OutlinedNumberBox()
|
||||
{
|
||||
InputProperties = new TextInputProperties(TextInputType.Number, false);
|
||||
}
|
||||
protected override bool AllowIme => false;
|
||||
|
||||
protected override bool CanAddCharacter(char character) => char.IsAsciiDigit(character);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user