2019-01-24 16:43:03 +08:00
|
|
|
|
// 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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Settings
|
|
|
|
|
{
|
|
|
|
|
public class SettingsHeader : Container
|
|
|
|
|
{
|
|
|
|
|
private readonly string heading;
|
|
|
|
|
private readonly string subheading;
|
|
|
|
|
|
|
|
|
|
public SettingsHeader(string heading, string subheading)
|
|
|
|
|
{
|
|
|
|
|
this.heading = heading;
|
|
|
|
|
this.subheading = subheading;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Text = heading,
|
2019-02-12 12:04:46 +08:00
|
|
|
|
Font = OsuFont.GetFont(size: 40),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Margin = new MarginPadding
|
|
|
|
|
{
|
2019-05-14 09:45:05 +08:00
|
|
|
|
Left = SettingsPanel.CONTENT_MARGINS,
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Top = Toolbar.Toolbar.TOOLTIP_HEIGHT
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Colour = colours.Pink,
|
|
|
|
|
Text = subheading,
|
2019-02-12 12:04:46 +08:00
|
|
|
|
Font = OsuFont.GetFont(size: 18),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Margin = new MarginPadding
|
|
|
|
|
{
|
2019-05-14 09:45:05 +08:00
|
|
|
|
Left = SettingsPanel.CONTENT_MARGINS,
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Bottom = 30
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|