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
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-04-21 13:37:11 +08:00
|
|
|
|
using osu.Framework.Localisation;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2021-11-09 04:38:01 +08:00
|
|
|
|
using osu.Game.Graphics.Containers;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Settings
|
|
|
|
|
{
|
|
|
|
|
public class SettingsHeader : Container
|
|
|
|
|
{
|
2021-04-21 13:37:11 +08:00
|
|
|
|
private readonly LocalisableString heading;
|
|
|
|
|
private readonly LocalisableString subheading;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2021-04-21 13:37:11 +08:00
|
|
|
|
public SettingsHeader(LocalisableString heading, LocalisableString subheading)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
this.heading = heading;
|
|
|
|
|
this.subheading = subheading;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2021-10-10 01:20:44 +08:00
|
|
|
|
private void load(OverlayColourProvider colourProvider)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2021-11-09 04:38:01 +08:00
|
|
|
|
new OsuTextFlowContainer
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2021-11-13 03:28:42 +08:00
|
|
|
|
Padding = new MarginPadding
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2021-11-13 03:28:42 +08:00
|
|
|
|
Horizontal = SettingsPanel.CONTENT_MARGINS,
|
2021-11-09 04:38:01 +08:00
|
|
|
|
Top = Toolbar.Toolbar.TOOLTIP_HEIGHT,
|
|
|
|
|
Bottom = 30
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
2021-11-09 04:38:01 +08:00
|
|
|
|
}.With(flow =>
|
|
|
|
|
{
|
|
|
|
|
flow.AddText(heading, header => header.Font = OsuFont.TorusAlternate.With(size: 40));
|
|
|
|
|
flow.NewLine();
|
|
|
|
|
flow.AddText(subheading, subheader =>
|
|
|
|
|
{
|
|
|
|
|
subheader.Colour = colourProvider.Content2;
|
|
|
|
|
subheader.Font = OsuFont.GetFont(size: 18);
|
|
|
|
|
});
|
|
|
|
|
})
|
2018-04-13 17:19:50 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|