1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Rework UserGridPanel to reduce containers nesting

This commit is contained in:
Andrei Zavatski 2024-02-01 16:13:36 +03:00
parent b0f6a87a2b
commit 2bd9dcf646

View File

@ -35,13 +35,10 @@ namespace osu.Game.Users
{
FillFlowContainer details;
var layout = new Container
var layout = new GridContainer
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding(margin),
Child = new GridContainer
{
RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
@ -50,7 +47,6 @@ namespace osu.Game.Users
RowDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
new Dimension(GridSizeMode.Absolute, margin),
new Dimension()
},
Content = new[]
@ -62,14 +58,12 @@ namespace osu.Game.Users
avatar.Size = new Vector2(60);
avatar.Masking = true;
avatar.CornerRadius = 6;
avatar.Margin = new MarginPadding { Bottom = margin };
}),
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = margin },
Child = new GridContainer
new GridContainer
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = margin, Bottom = margin },
ColumnDimensions = new[]
{
new Dimension()
@ -105,13 +99,6 @@ namespace osu.Game.Users
}
}
}
}
},
new[]
{
// padding
Empty(),
Empty()
},
new Drawable[]
{
@ -128,7 +115,6 @@ namespace osu.Game.Users
})
}
}
}
};
if (User.IsSupporter)