1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 03:55:30 +08:00
osu-lazer/osu.Game/Overlays/Settings/SettingsHeader.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.8 KiB
C#
Raw Normal View History

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