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:
parent
e753e3ee2f
commit
0b9c41c94e
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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));
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user