2019-01-24 08:43:03 +00: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 09:19:50 +00:00
|
|
|
|
|
2017-05-11 05:55:25 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-04-21 05:37:11 +00:00
|
|
|
|
using osu.Framework.Localisation;
|
2017-05-11 05:55:25 +00:00
|
|
|
|
using osu.Game.Graphics;
|
2021-11-08 20:38:01 +00:00
|
|
|
|
using osu.Game.Graphics.Containers;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-05-15 01:55:29 +00:00
|
|
|
|
namespace osu.Game.Overlays.Settings
|
2017-05-11 05:55:25 +00:00
|
|
|
|
{
|
2017-05-15 01:55:29 +00:00
|
|
|
|
public class SettingsHeader : Container
|
2017-05-11 05:55:25 +00:00
|
|
|
|
{
|
2021-04-21 05:37:11 +00:00
|
|
|
|
private readonly LocalisableString heading;
|
|
|
|
|
private readonly LocalisableString subheading;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2021-04-21 05:37:11 +00:00
|
|
|
|
public SettingsHeader(LocalisableString heading, LocalisableString subheading)
|
2017-08-10 13:21:22 +00:00
|
|
|
|
{
|
|
|
|
|
this.heading = heading;
|
|
|
|
|
this.subheading = subheading;
|
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-05-11 05:55:25 +00:00
|
|
|
|
[BackgroundDependencyLoader]
|
2021-10-09 17:20:44 +00:00
|
|
|
|
private void load(OverlayColourProvider colourProvider)
|
2017-05-11 05:55:25 +00:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-05-11 05:55:25 +00:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2021-11-08 20:38:01 +00:00
|
|
|
|
new OsuTextFlowContainer
|
2017-05-11 05:55:25 +00:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2021-11-12 19:28:42 +00:00
|
|
|
|
Padding = new MarginPadding
|
2017-05-11 05:55:25 +00:00
|
|
|
|
{
|
2021-11-12 19:28:42 +00:00
|
|
|
|
Horizontal = SettingsPanel.CONTENT_MARGINS,
|
2021-11-08 20:38:01 +00:00
|
|
|
|
Top = Toolbar.Toolbar.TOOLTIP_HEIGHT,
|
|
|
|
|
Bottom = 30
|
2017-05-11 05:55:25 +00:00
|
|
|
|
}
|
2021-11-08 20:38:01 +00: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);
|
|
|
|
|
});
|
|
|
|
|
})
|
2017-05-11 05:55:25 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-01-05 11:21:19 +00:00
|
|
|
|
}
|