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

Truncate name label and clean up positioning code

Also adds a test score with a long username.
This commit is contained in:
Joseph Madamba 2023-10-10 18:02:59 -07:00
parent 6087c12d85
commit bb3f426b93
2 changed files with 25 additions and 5 deletions

View File

@ -118,6 +118,22 @@ namespace osu.Game.Tests.Visual.SongSelect
},
Date = DateTimeOffset.Now,
},
new ScoreInfo
{
Position = 110000,
Rank = ScoreRank.A,
Accuracy = 1,
MaxCombo = 244,
TotalScore = 1707827,
Ruleset = new ManiaRuleset().RulesetInfo,
User = new APIUser
{
Id = 226597,
Username = @"WWWWWWWWWWWWWWWWWWWW",
CountryCode = CountryCode.US,
},
Date = DateTimeOffset.Now,
},
TestResources.CreateTestScoreInfo(),
};

View File

@ -216,16 +216,19 @@ namespace osu.Game.Online.Leaderboards
},
new FillFlowContainer
{
Position = new Vector2(9),
AutoSizeAxes = Axes.Both,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Padding = new MarginPadding { Horizontal = corner_radius },
Children = new Drawable[]
{
flagBadgeAndDateContainer = new FillFlowContainer
{
Shear = -shear,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5f, 0f),
Spacing = new Vector2(5),
AutoSizeAxes = Axes.Both,
Masking = true,
Children = new Drawable[]
@ -243,8 +246,9 @@ namespace osu.Game.Online.Leaderboards
}
}
},
nameLabel = new OsuSpriteText
nameLabel = new TruncatingSpriteText
{
RelativeSizeAxes = Axes.X,
Shear = -shear,
Text = user.Username,
Font = OsuFont.GetFont(size: 24, weight: FontWeight.SemiBold)
@ -254,7 +258,7 @@ namespace osu.Game.Online.Leaderboards
new FillFlowContainer
{
Margin = new MarginPadding { Right = 40 },
Spacing = new Vector2(25, 0),
Spacing = new Vector2(25),
Shear = -shear,
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,