1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-22 19:02:55 +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,46 +81,31 @@ 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
{
RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[] ColumnDimensions = new[]
{ {
new Dimension() new Dimension()
@ -156,24 +141,18 @@ namespace osu.Game.Users
} }
} }
} }
},
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
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
ColumnDimensions = new[] ColumnDimensions = new[]
{ {
new Dimension(), new Dimension(),
@ -196,7 +175,6 @@ namespace osu.Game.Users
} }
} }
} }
}
}; };
if (User.IsSupporter) if (User.IsSupporter)