Use public property instead of ctor parameter

This commit is contained in:
TheWildTree
2020-03-04 18:19:28 +01:00
parent e09fbcb05f
commit 276a90fb84
2 changed files with 4 additions and 5 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -52,7 +52,7 @@ namespace osu.Game.Overlays.Rankings.Tables
Spacing = new Vector2(0, row_spacing), Spacing = new Vector2(0, row_spacing),
}); });
rankings.ForEach(_ => backgroundFlow.Add(new TableRowBackground(row_height))); rankings.ForEach(_ => backgroundFlow.Add(new TableRowBackground { Height = row_height }));
Columns = mainHeaders.Concat(CreateAdditionalHeaders()).ToArray(); Columns = mainHeaders.Concat(CreateAdditionalHeaders()).ToArray();
Content = rankings.Select((s, i) => createContent((page - 1) * items_per_page + i, s)).ToArray().ToRectangular(); Content = rankings.Select((s, i) => createContent((page - 1) * items_per_page + i, s)).ToArray().ToRectangular();

View File

@ -1,4 +1,4 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation; using osu.Framework.Allocation;
@ -19,10 +19,9 @@ namespace osu.Game.Overlays.Rankings.Tables
private Color4 idleColour; private Color4 idleColour;
private Color4 hoverColour; private Color4 hoverColour;
public TableRowBackground(float height) public TableRowBackground()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = height;
CornerRadius = 4; CornerRadius = 4;
Masking = true; Masking = true;