From 9478fe5ec3830162fb4040bcd3fc3e0853548281 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 27 Dec 2019 13:15:55 +0900 Subject: [PATCH] Revert to using empty container, not null --- osu.Game/Overlays/OverlayHeader.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/OverlayHeader.cs b/osu.Game/Overlays/OverlayHeader.cs index 9e88273443..7a397d10c6 100644 --- a/osu.Game/Overlays/OverlayHeader.cs +++ b/osu.Game/Overlays/OverlayHeader.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using JetBrains.Annotations; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -37,14 +38,12 @@ namespace osu.Game.Overlays RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - FillFlowContainer flow; - - Add(flow = new FillFlowContainer + Add(new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, - Children = new Drawable[] + Children = new[] { background = new Container { @@ -95,19 +94,16 @@ namespace osu.Game.Overlays Padding = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN }, } } - } + }, + CreateContent() } }); - - var content = CreateContent(); - - if (content != null) - flow.Add(content); } protected abstract Drawable CreateBackground(); - protected virtual Drawable CreateContent() => null; + [NotNull] + protected virtual Drawable CreateContent() => new Container(); protected abstract ScreenTitle CreateTitle(); }