From e6f39c4cada3e180d524be7c5fc0a8d3e7e6b206 Mon Sep 17 00:00:00 2001 From: Lucas A Date: Mon, 8 Nov 2021 21:38:01 +0100 Subject: [PATCH 1/3] Fix settings header text overflowing with some locales. --- osu.Game/Overlays/Settings/SettingsHeader.cs | 43 ++++++++------------ 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/osu.Game/Overlays/Settings/SettingsHeader.cs b/osu.Game/Overlays/Settings/SettingsHeader.cs index 69b7b69a29..8d6e93be9d 100644 --- a/osu.Game/Overlays/Settings/SettingsHeader.cs +++ b/osu.Game/Overlays/Settings/SettingsHeader.cs @@ -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,27 @@ namespace osu.Game.Overlays.Settings Children = new Drawable[] { - new FillFlowContainer + new OsuTextFlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - Direction = FillDirection.Vertical, - Children = new Drawable[] + Margin = 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 - }, - }, + Left = 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); + }); + + }) }; } } From b7e7b0f850766a568e1e08aa985826402f27d1cb Mon Sep 17 00:00:00 2001 From: Lucas A Date: Mon, 8 Nov 2021 21:42:51 +0100 Subject: [PATCH 2/3] Trim whitespace. --- osu.Game/Overlays/Settings/SettingsHeader.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/SettingsHeader.cs b/osu.Game/Overlays/Settings/SettingsHeader.cs index 8d6e93be9d..53b3895390 100644 --- a/osu.Game/Overlays/Settings/SettingsHeader.cs +++ b/osu.Game/Overlays/Settings/SettingsHeader.cs @@ -48,7 +48,6 @@ namespace osu.Game.Overlays.Settings subheader.Colour = colourProvider.Content2; subheader.Font = OsuFont.GetFont(size: 18); }); - }) }; } From cb2d1f3f04ae864b330bd2470e5769bb6839536b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 12 Nov 2021 20:28:42 +0100 Subject: [PATCH 3/3] Use horizontally symmetrical padding rather than margin --- osu.Game/Overlays/Settings/SettingsHeader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Settings/SettingsHeader.cs b/osu.Game/Overlays/Settings/SettingsHeader.cs index 53b3895390..f9ee8df0bd 100644 --- a/osu.Game/Overlays/Settings/SettingsHeader.cs +++ b/osu.Game/Overlays/Settings/SettingsHeader.cs @@ -33,9 +33,9 @@ namespace osu.Game.Overlays.Settings { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - Margin = new MarginPadding + Padding = new MarginPadding { - Left = SettingsPanel.CONTENT_MARGINS, + Horizontal = SettingsPanel.CONTENT_MARGINS, Top = Toolbar.Toolbar.TOOLTIP_HEIGHT, Bottom = 30 }