Merge pull request #15559 from Game4all/fix-setting-header-text-overflow

Fix settings header localised text potentially overflowing out of the settings panel
This commit is contained in:
Dean Herbert 2021-11-13 14:48:42 +09:00 committed by GitHub
commit f208a931b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.Containers;
namespace osu.Game.Overlays.Settings
{
@ -29,36 +29,26 @@ namespace osu.Game.Overlays.Settings
Children = new Drawable[]
{
new FillFlowContainer
new OsuTextFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
Children = new Drawable[]
Padding = new MarginPadding
{
new OsuSpriteText
{
Text = heading,
Font = OsuFont.TorusAlternate.With(size: 40),
Margin = new MarginPadding
{
Left = SettingsPanel.CONTENT_MARGINS,
Top = Toolbar.Toolbar.TOOLTIP_HEIGHT
},
},
new OsuSpriteText
{
Colour = colourProvider.Content2,
Text = subheading,
Font = OsuFont.GetFont(size: 18),
Margin = new MarginPadding
{
Left = SettingsPanel.CONTENT_MARGINS,
Bottom = 30
},
},
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);
});
})
};
}
}