From 17791259ed16767dfced844a094fe9116d9a5db4 Mon Sep 17 00:00:00 2001 From: recapitalverb <41869184+recapitalverb@users.noreply.github.com> Date: Tue, 11 Feb 2020 16:21:31 +0700 Subject: [PATCH 1/4] Fix InfoColumn minWidth implementation --- .../Scores/TopScoreStatisticsSection.cs | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs index 6c9f0b0321..c441cb3101 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs @@ -118,26 +118,42 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { AutoSizeAxes = Axes.Both; - InternalChild = new FillFlowContainer + InternalChild = new GridContainer { AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 1), - Children = new[] + ColumnDimensions = new[] { - text = new OsuSpriteText + new Dimension(GridSizeMode.AutoSize, minSize: minWidth ?? 0) + }, + RowDimensions = new[] + { + new Dimension(GridSizeMode.AutoSize), + new Dimension(GridSizeMode.Absolute, 4), + new Dimension(GridSizeMode.AutoSize) + }, + Content = new[] + { + new[] { - Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold), - Text = title.ToUpper() + text = new OsuSpriteText + { + Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold), + Text = title.ToUpper() + } }, - separator = new Box + new[] { - RelativeSizeAxes = minWidth == null ? Axes.X : Axes.None, - Width = minWidth ?? 1f, - Height = 2, - Margin = new MarginPadding { Top = 2 } + separator = new Box + { + Anchor = Anchor.CentreLeft, + RelativeSizeAxes = Axes.X, + Height = 2 + } }, - content + new[] + { + content + } } }; } From 28a39fd8faa1ff463ea606de60048cdb10488ce3 Mon Sep 17 00:00:00 2001 From: recapitalverb <41869184+recapitalverb@users.noreply.github.com> Date: Tue, 11 Feb 2020 17:12:32 +0700 Subject: [PATCH 2/4] Use explicit typing --- .../Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs index c441cb3101..8a6927e048 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs @@ -131,9 +131,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores new Dimension(GridSizeMode.Absolute, 4), new Dimension(GridSizeMode.AutoSize) }, - Content = new[] + Content = new Drawable[][] { - new[] + new [] { text = new OsuSpriteText { From 44568ac9e6343a115fc9ed70db6a3194baf7b007 Mon Sep 17 00:00:00 2001 From: recapitalverb <41869184+recapitalverb@users.noreply.github.com> Date: Tue, 11 Feb 2020 17:36:10 +0700 Subject: [PATCH 3/4] Avoid covariant array conversion --- .../BeatmapSet/Scores/TopScoreStatisticsSection.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs index 8a6927e048..be6151278c 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs @@ -131,9 +131,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores new Dimension(GridSizeMode.Absolute, 4), new Dimension(GridSizeMode.AutoSize) }, - Content = new Drawable[][] + Content = new[] { - new [] + new Drawable[] { text = new OsuSpriteText { @@ -141,7 +141,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Text = title.ToUpper() } }, - new[] + new Drawable[] { separator = new Box { @@ -150,7 +150,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Height = 2 } }, - new[] + new Drawable[] { content } From 2be7d1a873b3de01080f00b850d00174a9d645d3 Mon Sep 17 00:00:00 2001 From: recapitalverb <41869184+recapitalverb@users.noreply.github.com> Date: Tue, 11 Feb 2020 18:19:08 +0700 Subject: [PATCH 4/4] Remove redundant type specification --- .../Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs index be6151278c..a7066c4827 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs @@ -150,7 +150,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Height = 2 } }, - new Drawable[] + new[] { content }