From 0cbc5e3593b37fa807cbfa24997c647707bc6286 Mon Sep 17 00:00:00 2001 From: marvin Date: Wed, 11 Jun 2025 10:15:54 +0200 Subject: [PATCH] Move `InternalChild` assignment into BDL --- .../Graphics/Containers/ExpandingContainer.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/Containers/ExpandingContainer.cs b/osu.Game/Graphics/Containers/ExpandingContainer.cs index 93595f186f..ad5c65c10e 100644 --- a/osu.Game/Graphics/Containers/ExpandingContainer.cs +++ b/osu.Game/Graphics/Containers/ExpandingContainer.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 osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -40,18 +41,24 @@ namespace osu.Game.Graphics.Containers RelativeSizeAxes = Axes.Y; Width = contractedWidth; - InternalChild = CreateScrollContainer().With(s => - { - s.RelativeSizeAxes = Axes.Both; - s.ScrollbarVisible = false; - }).WithChild(FillFlow = new FillFlowContainer + FillFlow = new FillFlowContainer { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, - }); + }; + } + + [BackgroundDependencyLoader] + private void load() + { + InternalChild = CreateScrollContainer().With(s => + { + s.RelativeSizeAxes = Axes.Both; + s.ScrollbarVisible = false; + }).WithChild(FillFlow); } protected virtual OsuScrollContainer CreateScrollContainer() => new OsuScrollContainer();