diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneFormControls.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneFormControls.cs index 9c05a340104b..be2ba860d308 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneFormControls.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneFormControls.cs @@ -58,8 +58,6 @@ public TestSceneFormControls() { Caption = EditorSetupStrings.LetterboxDuringBreaks, HintText = EditorSetupStrings.LetterboxDuringBreaksDescription, - OnText = "Letterbox", - OffText = "Do not letterbox", }, new FormCheckBox { diff --git a/osu.Game/Graphics/UserInterfaceV2/FormCheckBox.cs b/osu.Game/Graphics/UserInterfaceV2/FormCheckBox.cs index 587aa921f57c..6054e898fe7b 100644 --- a/osu.Game/Graphics/UserInterfaceV2/FormCheckBox.cs +++ b/osu.Game/Graphics/UserInterfaceV2/FormCheckBox.cs @@ -14,7 +14,9 @@ using osu.Framework.Localisation; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; +using osu.Game.Localisation; using osu.Game.Overlays; +using osuTK; namespace osu.Game.Graphics.UserInterfaceV2 { @@ -30,8 +32,6 @@ public Bindable Current public LocalisableString Caption { get; init; } public LocalisableString HintText { get; init; } - public LocalisableString OnText { get; init; } = "On"; - public LocalisableString OffText { get; init; } = "Off"; private Box background = null!; private FormFieldCaption caption = null!; @@ -74,17 +74,30 @@ private void load(AudioManager audio) Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, }, - text = new OsuSpriteText + new FillFlowContainer { RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, - }, - checkbox = new Nub - { - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - Current = Current, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(7), + Children = new Drawable[] + { + checkbox = new Nub + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Current = Current, + Margin = new MarginPadding { Top = 2, }, + }, + text = new OsuSpriteText + { + RelativeSizeAxes = Axes.X, + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + }, + } } }, }, @@ -141,7 +154,7 @@ private void updateState() checkbox.Colour = Current.Disabled ? colourProvider.Foreground1 : colourProvider.Content1; text.Colour = Current.Disabled ? colourProvider.Foreground1 : colourProvider.Content1; - text.Text = Current.Value ? OnText : OffText; + text.Text = Current.Value ? CommonStrings.Enabled : CommonStrings.Disabled; if (!Current.Disabled) {