1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 10:42:55 +08:00

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

View File

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