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:
commit
92cc45dc05
@ -13,7 +13,5 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
SelectAllOnFocus = true;
|
||||
}
|
||||
|
||||
protected override bool CanAddCharacter(char character) => char.IsAsciiDigit(character);
|
||||
}
|
||||
}
|
||||
|
@ -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]
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user