Load SettingsSubsection in load()

Fixes header not being displayed with variant bindings. This follows what SettingsSection does.
This commit is contained in:
smoogipooo 2017-08-23 12:48:53 +09:00
parent be96fb32b3
commit 38a4c84163
1 changed files with 17 additions and 9 deletions

View File

@ -7,14 +7,15 @@
using osu.Game.Graphics.Sprites;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
namespace osu.Game.Overlays.Settings
{
public abstract class SettingsSubsection : FillFlowContainer, IHasFilterableChildren
{
protected override Container<Drawable> Content => content;
protected override Container<Drawable> Content => FlowContent;
private readonly Container<Drawable> content;
protected readonly FillFlowContainer FlowContent;
protected abstract string Header { get; }
@ -33,6 +34,19 @@ protected SettingsSubsection()
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FillDirection.Vertical;
FlowContent = new FillFlowContainer
{
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5),
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
};
}
[BackgroundDependencyLoader]
private void load()
{
AddRangeInternal(new Drawable[]
{
new OsuSpriteText
@ -41,13 +55,7 @@ protected SettingsSubsection()
Margin = new MarginPadding { Bottom = 10 },
Font = @"Exo2.0-Black",
},
content = new FillFlowContainer
{
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5),
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
},
FlowContent
});
}
}