Merge pull request #7792 from recapitalverb/info-column-min-width

Fix InfoColumn minWidth implementation
This commit is contained in:
Dan Balasescu
2020-02-12 14:06:17 +09:00
committed by GitHub

View File

@ -118,27 +118,43 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
InternalChild = new FillFlowContainer InternalChild = new GridContainer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical, ColumnDimensions = new[]
Spacing = new Vector2(0, 1), {
Children = new[] 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 Drawable[]
{ {
text = new OsuSpriteText text = new OsuSpriteText
{ {
Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold),
Text = title.ToUpper() Text = title.ToUpper()
}
}, },
new Drawable[]
{
separator = new Box separator = new Box
{ {
RelativeSizeAxes = minWidth == null ? Axes.X : Axes.None, Anchor = Anchor.CentreLeft,
Width = minWidth ?? 1f, RelativeSizeAxes = Axes.X,
Height = 2, Height = 2
Margin = new MarginPadding { Top = 2 } }
}, },
new[]
{
content content
} }
}
}; };
} }