1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 10:02:54 +08:00

Merge branch 'text-input-properties' into scroll-container-double-precision

This commit is contained in:
Bartłomiej Dach 2025-01-14 09:51:48 +01:00
commit 92cc45dc05
No known key found for this signature in database
4 changed files with 8 additions and 6 deletions

View File

@ -13,7 +13,5 @@ namespace osu.Game.Graphics.UserInterface
SelectAllOnFocus = true;
}
protected override bool CanAddCharacter(char character) => char.IsAsciiDigit(character);
}
}

View File

@ -28,10 +28,6 @@ namespace osu.Game.Graphics.UserInterface
protected override bool AllowUniqueCharacterSamples => false;
protected override bool AllowClipboardExport => false;
protected override bool AllowWordNavigation => false;
private readonly CapsWarning warning;
[Resolved]

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System.Globalization;
using osu.Framework.Input;
namespace osu.Game.Graphics.UserInterfaceV2
{
@ -19,6 +20,11 @@ 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));
}

View File

@ -7,6 +7,7 @@ using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Game.Configuration;
using osu.Game.Graphics;
@ -63,6 +64,7 @@ namespace osu.Game.Overlays.Login
},
username = new OsuTextBox
{
InputProperties = new TextInputProperties(TextInputType.Username, false),
PlaceholderText = UsersStrings.LoginUsername.ToLower(),
RelativeSizeAxes = Axes.X,
Text = api.ProvidedUsername,