1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Remove more GridContainer nonsense

This commit is contained in:
Dean Herbert 2023-06-28 18:17:57 +09:00
parent 8c4831e09f
commit 98bf15182e
2 changed files with 15 additions and 38 deletions

View File

@ -26,18 +26,13 @@ namespace osu.Game.Screens.Ranking.Statistics
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
InternalChild = new GridContainer InternalChild = new FillFlowContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Content = new[] Children = new[]
{
new[]
{
createHeader(item)
},
new Drawable[]
{ {
createHeader(item),
new Container new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -45,12 +40,6 @@ namespace osu.Game.Screens.Ranking.Statistics
Margin = new MarginPadding { Top = 15 }, Margin = new MarginPadding { Top = 15 },
Child = item.CreateContent() Child = item.CreateContent()
} }
},
},
RowDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
new Dimension(GridSizeMode.AutoSize),
} }
}; };
} }

View File

@ -124,7 +124,7 @@ namespace osu.Game.Screens.Ranking.Statistics
} }
else else
{ {
FillFlowContainer rows; FillFlowContainer flow;
container = new OsuScrollContainer(Direction.Vertical) container = new OsuScrollContainer(Direction.Vertical)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -133,11 +133,12 @@ namespace osu.Game.Screens.Ranking.Statistics
Alpha = 0, Alpha = 0,
Children = new[] Children = new[]
{ {
rows = new FillFlowContainer flow = new FillFlowContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Spacing = new Vector2(30, 15) Spacing = new Vector2(30, 15),
Direction = FillDirection.Full,
} }
} }
}; };
@ -146,35 +147,22 @@ namespace osu.Game.Screens.Ranking.Statistics
foreach (var item in statisticItems) foreach (var item in statisticItems)
{ {
var columnContent = new List<Drawable>();
if (!hitEventsAvailable && item.RequiresHitEvents) if (!hitEventsAvailable && item.RequiresHitEvents)
{ {
anyRequiredHitEvents = true; anyRequiredHitEvents = true;
continue; continue;
} }
columnContent.Add(new StatisticContainer(item) flow.Add(new StatisticContainer(item)
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
}); });
rows.Add(new GridContainer
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Content = new[] { columnContent.ToArray() },
ColumnDimensions = new[] { new Dimension() },
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) }
});
} }
if (anyRequiredHitEvents) if (anyRequiredHitEvents)
{ {
rows.Add(new FillFlowContainer flow.Add(new FillFlowContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,