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

Refactor UserRankPanel layout

This commit is contained in:
Andrei Zavatski 2024-02-01 16:33:54 +03:00
parent 2bd9dcf646
commit 66350fd148

View File

@ -81,117 +81,95 @@ namespace osu.Game.Users
}, },
new GridContainer new GridContainer
{ {
AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Both,
RelativeSizeAxes = Axes.X, Padding = new MarginPadding(padding),
ColumnDimensions = new[] ColumnDimensions = new[]
{ {
new Dimension(GridSizeMode.Absolute, padding),
new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize),
new Dimension(), new Dimension(),
new Dimension(GridSizeMode.Absolute, padding),
}, },
RowDimensions = new[] RowDimensions = new[]
{ {
new Dimension(GridSizeMode.Absolute, padding), new Dimension()
new Dimension(GridSizeMode.AutoSize),
}, },
Content = new[] Content = new[]
{ {
new[] new Drawable[]
{ {
// padding
Empty(),
Empty(),
Empty(),
Empty()
},
new[]
{
Empty(), // padding
CreateAvatar().With(avatar => CreateAvatar().With(avatar =>
{ {
avatar.Size = new Vector2(60); avatar.Size = new Vector2(60);
avatar.Masking = true; avatar.Masking = true;
avatar.CornerRadius = 6; avatar.CornerRadius = 6;
}), }),
new Container new GridContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = padding }, Padding = new MarginPadding { Left = padding },
Child = new GridContainer ColumnDimensions = new[]
{ {
RelativeSizeAxes = Axes.Both, new Dimension()
ColumnDimensions = new[] },
RowDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
new Dimension()
},
Content = new[]
{
new Drawable[]
{ {
new Dimension() details = new FillFlowContainer
},
RowDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
new Dimension()
},
Content = new[]
{
new Drawable[]
{ {
details = new FillFlowContainer AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(6),
Children = new Drawable[]
{ {
AutoSizeAxes = Axes.Both, CreateFlag(),
Direction = FillDirection.Horizontal, // supporter icon is being added later
Spacing = new Vector2(6),
Children = new Drawable[]
{
CreateFlag(),
// supporter icon is being added later
}
} }
},
new Drawable[]
{
CreateUsername().With(username =>
{
username.Anchor = Anchor.CentreLeft;
username.Origin = Anchor.CentreLeft;
})
} }
},
new Drawable[]
{
CreateUsername().With(username =>
{
username.Anchor = Anchor.CentreLeft;
username.Origin = Anchor.CentreLeft;
})
} }
} }
}, }
Empty() // padding
} }
} }
} }
} }
}, },
new Container new GridContainer
{ {
Name = "Bottom content", Name = "Bottom content",
Margin = new MarginPadding { Top = main_content_height }, Margin = new MarginPadding { Top = main_content_height },
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Left = 80, Vertical = padding }, Padding = new MarginPadding { Left = 80, Vertical = padding },
Child = new GridContainer ColumnDimensions = new[]
{ {
RelativeSizeAxes = Axes.X, new Dimension(),
AutoSizeAxes = Axes.Y, new Dimension()
ColumnDimensions = new[] },
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
Content = new[]
{
new Drawable[]
{ {
new Dimension(), globalRankDisplay = new ProfileValueDisplay(true)
new Dimension()
},
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
Content = new[]
{
new Drawable[]
{ {
globalRankDisplay = new ProfileValueDisplay(true) Title = UsersStrings.ShowRankGlobalSimple,
{ },
Title = UsersStrings.ShowRankGlobalSimple, countryRankDisplay = new ProfileValueDisplay(true)
}, {
countryRankDisplay = new ProfileValueDisplay(true) Title = UsersStrings.ShowRankCountrySimple,
{
Title = UsersStrings.ShowRankCountrySimple,
}
} }
} }
} }