1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 09:20:04 +08:00

Attempt to address design concerns

This commit is contained in:
Bartłomiej Dach
2024-09-13 09:59:20 +02:00
Unverified
parent 2c19b7994c
commit 652a590611
2 changed files with 23 additions and 12 deletions
@@ -58,8 +58,6 @@ namespace osu.Game.Tests.Visual.UserInterface
{
Caption = EditorSetupStrings.LetterboxDuringBreaks,
HintText = EditorSetupStrings.LetterboxDuringBreaksDescription,
OnText = "Letterbox",
OffText = "Do not letterbox",
},
new FormCheckBox
{
@@ -14,7 +14,9 @@ using osu.Framework.Input.Events;
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 @@ namespace osu.Game.Graphics.UserInterfaceV2
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 @@ namespace osu.Game.Graphics.UserInterfaceV2
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 @@ namespace osu.Game.Graphics.UserInterfaceV2
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)
{