1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-07 17:52:54 +08:00

Cleanup tooltip layout

Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
This commit is contained in:
dekrain 2022-02-01 20:26:52 +01:00
parent f87920cd83
commit eee020f8e4
No known key found for this signature in database
GPG Key ID: E20077A4AB510334

View File

@ -10,7 +10,6 @@ using osuTK;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.UI; using osu.Game.Rulesets.UI;
@ -49,7 +48,7 @@ namespace osu.Game.Online.Leaderboards
}, },
new FillFlowContainer new FillFlowContainer
{ {
Margin = new MarginPadding(5f), Margin = new MarginPadding(5),
Spacing = new Vector2(10), Spacing = new Vector2(10),
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
@ -63,8 +62,10 @@ namespace osu.Game.Online.Leaderboards
// Mods row // Mods row
modStatistics = new FillFlowContainer<ModCell> modStatistics = new FillFlowContainer<ModCell>
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical, RelativeSizeAxes = Axes.X,
Direction = FillDirection.Full,
Spacing = new Vector2(5, 0),
}, },
new FillFlowContainer new FillFlowContainer
{ {
@ -77,11 +78,13 @@ namespace osu.Game.Online.Leaderboards
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Spacing = new Vector2(10, 0),
}, },
bottomScoreStatistics = new FillFlowContainer<HitResultCell> bottomScoreStatistics = new FillFlowContainer<HitResultCell>
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Spacing = new Vector2(10, 0),
}, },
} }
}, },
@ -133,7 +136,6 @@ namespace osu.Game.Online.Leaderboards
public HitResultCell(HitResultDisplayStatistic stat) public HitResultCell(HitResultDisplayStatistic stat)
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
Padding = new MarginPadding { Horizontal = 5f };
displayName = stat.DisplayName; displayName = stat.DisplayName;
result = stat.Result; result = stat.Result;
@ -148,35 +150,17 @@ namespace osu.Game.Online.Leaderboards
Height = 12, Height = 12,
AutoSizeAxes = Axes.X, AutoSizeAxes = Axes.X,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Spacing = new Vector2(2f, 0f), Spacing = new Vector2(5f, 0f),
Children = new Drawable[] Children = new Drawable[]
{ {
new CircularContainer
{
AutoSizeAxes = Axes.X,
RelativeSizeAxes = Axes.Y,
Masking = true,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4Extensions.FromHex("#222")
},
new OsuSpriteText new OsuSpriteText
{ {
Padding = new MarginPadding(2),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Font = OsuFont.Torus.With(size: 12, weight: FontWeight.SemiBold), Font = OsuFont.Torus.With(size: 12, weight: FontWeight.SemiBold),
Text = displayName.ToUpperInvariant(), Text = displayName.ToUpperInvariant(),
Colour = colours.ForHitResult(result), Colour = colours.ForHitResult(result),
}
}
}, },
new OsuSpriteText new OsuSpriteText
{ {
RelativeSizeAxes = Axes.Y,
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold), Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
Text = count.ToString(), Text = count.ToString(),
}, },
@ -192,7 +176,6 @@ namespace osu.Game.Online.Leaderboards
public ModCell(Mod mod) public ModCell(Mod mod)
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
Padding = new MarginPadding { Horizontal = 5f };
this.mod = mod; this.mod = mod;
} }
@ -228,6 +211,7 @@ namespace osu.Game.Online.Leaderboards
Text = mod.SettingDescription, Text = mod.SettingDescription,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Margin = new MarginPadding { Top = 1 },
}); });
} }
} }