diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneScreenFooterNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneScreenFooterNavigation.cs index 27c7528efa2a..7c8ff56a57f5 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneScreenFooterNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneScreenFooterNavigation.cs @@ -349,8 +349,8 @@ private void load() AutoSizeAxes = Axes.Both, Children = new[] { - new ShearedButton(200) { Text = "Action #1", Action = () => { } }, - new ShearedButton(140) { Text = "Action #2", Action = () => { } }, + new ShearedButton { Width = 200, Text = "Action #1", Action = () => { } }, + new ShearedButton { Width = 140, Text = "Action #2", Action = () => { } }, } }; } diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneButtonsInput.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneButtonsInput.cs index f30b82d618b7..5c98f27d8618 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneButtonsInput.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneButtonsInput.cs @@ -72,12 +72,13 @@ public TestSceneButtonsInput() Enabled = { Value = true }, Text = "Rounded button" }, - shearedButton = new ShearedButton(width) + shearedButton = new ShearedButton { Text = "Sheared button", LighterColour = Colour4.FromHex("#FFFFFF"), DarkerColour = Colour4.FromHex("#FFCC22"), TextColour = Colour4.Black, + Width = width, Height = 40, Enabled = { Value = true }, Padding = new MarginPadding(0) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs index 0da7c3eb958d..1f2c34b516a2 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs @@ -342,8 +342,8 @@ private void load() AutoSizeAxes = Axes.Both, Children = new[] { - new ShearedButton(200) { Text = "Action #1", Action = () => { } }, - new ShearedButton(140) { Text = "Action #2", Action = () => { } }, + new ShearedButton { Width = 200, Text = "Action #1", Action = () => { } }, + new ShearedButton { Width = 140, Text = "Action #2", Action = () => { } }, } }; } diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneShearedButtons.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneShearedButtons.cs index bdec96f44681..d26d72569023 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneShearedButtons.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneShearedButtons.cs @@ -11,8 +11,10 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Testing; using osu.Framework.Utils; +using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays; +using osu.Game.Screens.Footer; using osuTK.Input; namespace osu.Game.Tests.Visual.UserInterface @@ -36,8 +38,10 @@ public void TestShearedButton(bool bigButton) if (bigButton) { - Child = button = new ShearedButton(400, 80) + Child = button = new ShearedButton { + Width = 400, + Height = 80, LighterColour = Colour4.FromHex("#FFFFFF"), DarkerColour = Colour4.FromHex("#FFCC22"), TextColour = Colour4.Black, @@ -50,8 +54,10 @@ public void TestShearedButton(bool bigButton) } else { - Child = button = new ShearedButton(200, 80) + Child = button = new ShearedButton { + Width = 200, + Height = 80, LighterColour = Colour4.FromHex("#FF86DD"), DarkerColour = Colour4.FromHex("#DE31AE"), TextColour = Colour4.White, @@ -79,8 +85,9 @@ public void TestShearedToggleButton() AddStep("create button", () => { - Child = button = new ShearedToggleButton(200) + Child = button = new ShearedToggleButton { + Width = 200, Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "Toggle me", @@ -91,13 +98,49 @@ public void TestShearedToggleButton() AddToggleStep("toggle disabled", disabled => button.Active.Disabled = disabled); } + [TestCase(true)] + [TestCase(false)] + public void TestShearedFooterButton(bool withIcon) + { + var colours = new OsuColour(); + + ShearedFooterButton button = null!; + bool actionFired = false; + + AddStep("create button", () => + { + Child = button = new ShearedFooterButton + { + Width = 220, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + LighterColour = colours.Blue1, + DarkerColour = colours.Blue3, + Text = "Add to playlist", + Action = () => actionFired = true, + }; + + if (withIcon) + button.Icon = OsuIcon.Add; + }); + + AddStep("set disabled", () => button.Enabled.Value = false); + AddStep("press button", () => button.TriggerClick()); + AddAssert("action not fired", () => !actionFired); + + AddStep("set enabled", () => button.Enabled.Value = true); + AddStep("press button", () => button.TriggerClick()); + AddAssert("action fired", () => actionFired); + } + [Test] public void TestSizing() { ShearedToggleButton toggleButton = null; - AddStep("create fixed width button", () => Child = toggleButton = new ShearedToggleButton(200) + AddStep("create fixed width button", () => Child = toggleButton = new ShearedToggleButton { + Width = 200, Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "Fixed width" @@ -109,6 +152,7 @@ public void TestSizing() AddStep("create auto-sizing button", () => Child = toggleButton = new ShearedToggleButton { + AutoSizeAxes = Axes.X, Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "This button autosizes to its text!" @@ -130,8 +174,9 @@ public void TestDisabledState() AddStep("create button", () => { - Child = button = new ShearedToggleButton(200) + Child = button = new ShearedToggleButton { + Width = 200, Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "Toggle me", @@ -186,6 +231,7 @@ public void TestButtons() { new ShearedButton { + AutoSizeAxes = Axes.X, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Text = "Button", @@ -194,6 +240,7 @@ public void TestButtons() }, new ShearedButton { + AutoSizeAxes = Axes.X, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Text = "Button", @@ -202,6 +249,7 @@ public void TestButtons() }, new ShearedButton { + AutoSizeAxes = Axes.X, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Text = "Button", diff --git a/osu.Game/Graphics/OsuIcon.cs b/osu.Game/Graphics/OsuIcon.cs index a02c61128528..3ccdf0733c1a 100644 --- a/osu.Game/Graphics/OsuIcon.cs +++ b/osu.Game/Graphics/OsuIcon.cs @@ -90,6 +90,8 @@ public static class OsuIcon public static IconUsage Twitter => get(OsuIconMapping.Twitter); public static IconUsage UserInterface => get(OsuIconMapping.UserInterface); public static IconUsage Wiki => get(OsuIconMapping.Wiki); + public static IconUsage Add => get(OsuIconMapping.Add); + public static IconUsage Remove => get(OsuIconMapping.Remove); public static IconUsage EditorAddControlPoint => get(OsuIconMapping.EditorAddControlPoint); public static IconUsage EditorConvertToStream => get(OsuIconMapping.EditorConvertToStream); public static IconUsage EditorDistanceSnap => get(OsuIconMapping.EditorDistanceSnap); @@ -396,6 +398,12 @@ private enum OsuIconMapping [Description(@"wiki")] Wiki, + [Description(@"add")] + Add, + + [Description(@"remove")] + Remove, + [Description(@"Editor/add-control-point")] EditorAddControlPoint = 1000, diff --git a/osu.Game/Graphics/UserInterface/ShearedButton.cs b/osu.Game/Graphics/UserInterface/ShearedButton.cs index 2047fc74f40e..3f8b5cf70731 100644 --- a/osu.Game/Graphics/UserInterface/ShearedButton.cs +++ b/osu.Game/Graphics/UserInterface/ShearedButton.cs @@ -75,19 +75,11 @@ public Colour4 TextColour protected readonly Container ButtonContent; /// - /// Creates a new + /// Creates a new /// - /// - /// The width of the button. - /// - /// If a non- value is provided, this button will have a fixed width equal to the provided value. - /// If a value is provided (or the argument is omitted entirely), the button will autosize in width to fit the text. - /// - /// - /// The height of the button. - public ShearedButton(float? width = null, float height = DEFAULT_HEIGHT) + public ShearedButton() { - Height = height; + Height = DEFAULT_HEIGHT; Shear = OsuGame.SHEAR; @@ -99,27 +91,25 @@ public ShearedButton(float? width = null, float height = DEFAULT_HEIGHT) { backgroundLayer = new Container { - RelativeSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.Both, CornerRadius = CORNER_RADIUS, Masking = true, BorderThickness = BORDER_THICKNESS, - Children = new Drawable[] + Child = background = new Box { - background = new Box - { - RelativeSizeAxes = Axes.Both - }, - ButtonContent = new Container - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - AutoSizeAxes = Axes.Both, - Shear = -OsuGame.SHEAR, - Child = text = new OsuSpriteText - { - Font = OsuFont.TorusAlternate.With(size: 17), - } - }, + RelativeSizeAxes = Axes.Both, + }, + }, + ButtonContent = new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + AutoSizeAxes = Axes.Both, + Shear = -OsuGame.SHEAR, + Child = text = new OsuSpriteText + { + Font = OsuFont.TorusAlternate.With(size: 17), + Margin = new MarginPadding { Horizontal = 15 }, } }, flashLayer = new Box @@ -130,18 +120,6 @@ public ShearedButton(float? width = null, float height = DEFAULT_HEIGHT) Alpha = 0, }, }; - - if (width != null) - { - Width = width.Value; - backgroundLayer.RelativeSizeAxes = Axes.Both; - } - else - { - AutoSizeAxes = Axes.X; - backgroundLayer.AutoSizeAxes = Axes.X; - text.Margin = new MarginPadding { Horizontal = 15 }; - } } protected override HoverSounds CreateHoverSounds(HoverSampleSet sampleSet) => new HoverClickSounds(sampleSet) { Enabled = { BindTarget = Enabled } }; diff --git a/osu.Game/Graphics/UserInterface/ShearedToggleButton.cs b/osu.Game/Graphics/UserInterface/ShearedToggleButton.cs index c2f547ba1933..7731425635ca 100644 --- a/osu.Game/Graphics/UserInterface/ShearedToggleButton.cs +++ b/osu.Game/Graphics/UserInterface/ShearedToggleButton.cs @@ -24,21 +24,6 @@ public partial class ShearedToggleButton : ShearedButton /// public BindableBool Active { get; } = new BindableBool(); - /// - /// Creates a new - /// - /// - /// The width of the button. - /// - /// If a non- value is provided, this button will have a fixed width equal to the provided value. - /// If a value is provided (or the argument is omitted entirely), the button will autosize in width to fit the text. - /// - /// - public ShearedToggleButton(float? width = null) - : base(width) - { - } - [BackgroundDependencyLoader] private void load(AudioManager audio) { diff --git a/osu.Game/Overlays/Mods/AddPresetButton.cs b/osu.Game/Overlays/Mods/AddPresetButton.cs index e4f7f83c1102..0844291f91df 100644 --- a/osu.Game/Overlays/Mods/AddPresetButton.cs +++ b/osu.Game/Overlays/Mods/AddPresetButton.cs @@ -27,7 +27,6 @@ public partial class AddPresetButton : ShearedToggleButton, IHasPopover private Bindable> selectedMods { get; set; } = null!; public AddPresetButton() - : base(1) { RelativeSizeAxes = Axes.X; Height = ModSelectPanel.HEIGHT; diff --git a/osu.Game/Overlays/Mods/AddPresetPopover.cs b/osu.Game/Overlays/Mods/AddPresetPopover.cs index 817a61f7ac60..831f03f78c57 100644 --- a/osu.Game/Overlays/Mods/AddPresetPopover.cs +++ b/osu.Game/Overlays/Mods/AddPresetPopover.cs @@ -74,11 +74,12 @@ public AddPresetPopover(AddPresetButton addPresetButton) Direction = FillDirection.Vertical, Children = new Drawable[] { - createButton = new ShearedButton(content_width) + createButton = new ShearedButton { // todo: for some very odd reason, this needs to be anchored to topright for the fill flow to be correctly sized to the AABB of the sheared button Anchor = Anchor.TopRight, Origin = Anchor.TopRight, + Width = content_width, Text = ModSelectOverlayStrings.AddPreset, Action = createPreset } diff --git a/osu.Game/Overlays/Mods/DeselectAllModsButton.cs b/osu.Game/Overlays/Mods/DeselectAllModsButton.cs index 0e60fc34147e..9b8ae1e3b6b0 100644 --- a/osu.Game/Overlays/Mods/DeselectAllModsButton.cs +++ b/osu.Game/Overlays/Mods/DeselectAllModsButton.cs @@ -15,8 +15,9 @@ public partial class DeselectAllModsButton : ShearedButton private readonly Bindable> selectedMods = new Bindable>(); public DeselectAllModsButton(ModSelectOverlay modSelectOverlay) - : base(ModSelectOverlay.BUTTON_WIDTH) { + Width = ModSelectOverlay.BUTTON_WIDTH; + Text = CommonStrings.DeselectAll; Action = modSelectOverlay.DeselectAll; diff --git a/osu.Game/Overlays/Mods/EditPresetPopover.cs b/osu.Game/Overlays/Mods/EditPresetPopover.cs index eb128c77921a..820ffad26551 100644 --- a/osu.Game/Overlays/Mods/EditPresetPopover.cs +++ b/osu.Game/Overlays/Mods/EditPresetPopover.cs @@ -114,22 +114,24 @@ private void load() Direction = FillDirection.Vertical, Children = new Drawable[] { - useCurrentModsButton = new ShearedButton(content_width) + useCurrentModsButton = new ShearedButton { // todo: for some very odd reason, this needs to be anchored to topright for the fill flow to be correctly sized to the AABB of the sheared button Anchor = Anchor.TopRight, Origin = Anchor.TopRight, + Width = content_width, Text = ModSelectOverlayStrings.UseCurrentMods, DarkerColour = colours.Blue1, LighterColour = colours.Blue0, TextColour = colourProvider.Background6, Action = useCurrentMods, }, - saveButton = new ShearedButton(content_width) + saveButton = new ShearedButton { // todo: for some very odd reason, this needs to be anchored to topright for the fill flow to be correctly sized to the AABB of the sheared button Anchor = Anchor.TopRight, Origin = Anchor.TopRight, + Width = content_width, Text = Resources.Localisation.Web.CommonStrings.ButtonsSave, DarkerColour = colours.Orange1, LighterColour = colours.Orange0, diff --git a/osu.Game/Overlays/Mods/SelectAllModsButton.cs b/osu.Game/Overlays/Mods/SelectAllModsButton.cs index 1da762d164f6..2fb72ef2c423 100644 --- a/osu.Game/Overlays/Mods/SelectAllModsButton.cs +++ b/osu.Game/Overlays/Mods/SelectAllModsButton.cs @@ -18,8 +18,9 @@ public partial class SelectAllModsButton : ShearedButton private readonly Bindable searchTerm = new Bindable(); public SelectAllModsButton(FreeModSelectOverlay modSelectOverlay) - : base(ModSelectOverlay.BUTTON_WIDTH) { + Width = ModSelectOverlay.BUTTON_WIDTH; + Text = CommonStrings.SelectAll; Action = modSelectOverlay.SelectAll; diff --git a/osu.Game/Overlays/WizardOverlay.cs b/osu.Game/Overlays/WizardOverlay.cs index 3cc403dbffef..a75f1aff3c2d 100644 --- a/osu.Game/Overlays/WizardOverlay.cs +++ b/osu.Game/Overlays/WizardOverlay.cs @@ -245,10 +245,9 @@ private void load(OverlayColourProvider colourProvider) Padding = new MarginPadding { Right = OsuGame.SCREEN_EDGE_MARGIN }; - InternalChild = NextButton = new ShearedButton(0) + InternalChild = NextButton = new ShearedButton { RelativeSizeAxes = Axes.X, - Width = 1, Text = FirstRunSetupOverlayStrings.GetStarted, DarkerColour = colourProvider.Colour3, LighterColour = colourProvider.Colour2, diff --git a/osu.Game/Screens/Footer/ScreenBackButton.cs b/osu.Game/Screens/Footer/ScreenBackButton.cs index 481192088c36..37d4260d1825 100644 --- a/osu.Game/Screens/Footer/ScreenBackButton.cs +++ b/osu.Game/Screens/Footer/ScreenBackButton.cs @@ -32,14 +32,11 @@ public sealed override bool ReceivePositionalInputAt(Vector2 screenSpacePos) return inputRectangle.Contains(ToLocalSpace(screenSpacePos)); } - public ScreenBackButton() - : base(BUTTON_WIDTH) - { - } - [BackgroundDependencyLoader] private void load() { + Width = BUTTON_WIDTH; + ButtonContent.Child = new FillFlowContainer { X = -10f, diff --git a/osu.Game/Screens/Footer/ShearedFooterButton.cs b/osu.Game/Screens/Footer/ShearedFooterButton.cs new file mode 100644 index 000000000000..4fb20b898dd2 --- /dev/null +++ b/osu.Game/Screens/Footer/ShearedFooterButton.cs @@ -0,0 +1,88 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Localisation; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osuTK; + +namespace osu.Game.Screens.Footer +{ + /// + /// A intended to be used on the + /// Allows displaying an additional icon displayed on the right hand side of the button. + /// + public partial class ShearedFooterButton : ShearedButton + { + public new LocalisableString Text + { + get => text.Text; + set => text.Text = value; + } + + public IconUsage Icon + { + get => icon.Icon; + set + { + icon.Icon = value; + icon.Alpha = icon.Icon.Equals(default) ? 0 : 1; + } + } + + public Vector2 IconSize + { + get => icon.Size; + set => icon.Size = value; + } + + private readonly OsuSpriteText text; + private readonly SpriteIcon icon; + + public ShearedFooterButton() + { + ButtonContent.AutoSizeAxes = Axes.None; + ButtonContent.RelativeSizeAxes = Axes.Both; + ButtonContent.Padding = new MarginPadding { Horizontal = 15 }; + + ButtonContent.Child = new GridContainer + { + RelativeSizeAxes = Axes.Both, + ColumnDimensions = new[] + { + new Dimension(), + new Dimension(GridSizeMode.AutoSize), + }, + Content = new[] + { + new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.Both, + Child = text = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Font = OsuFont.TorusAlternate.With(size: 17), + }, + }, + icon = new SpriteIcon + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Size = new Vector2(20), + Shadow = true, + ShadowOffset = new Vector2(0.8f, 0.8f), + Alpha = 0, + }, + }, + } + }; + } + } +} diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs index da4b3e96023a..87d50213ee8c 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs @@ -269,12 +269,13 @@ public void SetState(MatchmakingScreenState newState) AvailablePools = { BindTarget = availablePools }, SelectedPool = { BindTarget = selectedPool } }, - new BeginQueueingButton(200) + new BeginQueueingButton { DarkerColour = colours.Blue2, LighterColour = colours.Blue1, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, + Width = 200, SelectedPool = { BindTarget = selectedPool }, Action = () => { @@ -308,12 +309,13 @@ public void SetState(MatchmakingScreenState newState) { State = { Value = Visibility.Visible }, }, - new ShearedButton(200) + new ShearedButton { DarkerColour = colours.Red3, LighterColour = colours.Red4, Anchor = Anchor.Centre, Origin = Anchor.Centre, + Width = 200, Text = "Stop queueing", Action = () => client.MatchmakingLeaveQueue().FireAndForget() } @@ -430,11 +432,6 @@ private partial class BeginQueueingButton : SelectionButton { public readonly IBindable SelectedPool = new Bindable(); - public BeginQueueingButton(float? width = null) - : base(width) - { - } - protected override void LoadComplete() { base.LoadComplete(); @@ -445,11 +442,6 @@ protected override void LoadComplete() private partial class SelectionButton : ShearedButton, IKeyBindingHandler { - protected SelectionButton(float? width = null, float height = DEFAULT_HEIGHT) - : base(width, height) - { - } - public bool OnPressed(KeyBindingPressEvent e) { if (e.Action == GlobalAction.Select && !e.Repeat) diff --git a/osu.Game/Screens/OnlinePlay/Playlists/AddToPlaylistFooterButton.cs b/osu.Game/Screens/OnlinePlay/Playlists/AddToPlaylistFooterButton.cs index 1d8dcf37ab74..844c0d33086c 100644 --- a/osu.Game/Screens/OnlinePlay/Playlists/AddToPlaylistFooterButton.cs +++ b/osu.Game/Screens/OnlinePlay/Playlists/AddToPlaylistFooterButton.cs @@ -5,47 +5,23 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Transforms; using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; +using osu.Game.Screens.Footer; namespace osu.Game.Screens.OnlinePlay.Playlists { - public partial class AddToPlaylistFooterButton : ShearedButton + public partial class AddToPlaylistFooterButton : ShearedFooterButton { - public AddToPlaylistFooterButton() - : base(width: 220) - { - } - [BackgroundDependencyLoader] private void load(OsuColour colours) { + Width = 220; + DarkerColour = colours.Blue3; LighterColour = colours.Blue1; - ButtonContent.Children = new Drawable[] - { - new OsuSpriteText - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - X = -10, - Font = OsuFont.TorusAlternate.With(size: 17), - Text = OnlinePlayStrings.FooterButtonPlaylistAdd, - UseFullGlyphHeight = false, - }, - new OsuSpriteText - { - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - X = 35, - Font = OsuFont.TorusAlternate.With(size: 20), - Shadow = false, - Text = "+", - UseFullGlyphHeight = false, - }, - }; + Text = OnlinePlayStrings.FooterButtonPlaylistAdd; + Icon = OsuIcon.Add; } public void Appear() diff --git a/osu.Game/Screens/SelectV2/BeatmapDetailsArea.Header.cs b/osu.Game/Screens/SelectV2/BeatmapDetailsArea.Header.cs index f4a223985d45..e17328b4061d 100644 --- a/osu.Game/Screens/SelectV2/BeatmapDetailsArea.Header.cs +++ b/osu.Game/Screens/SelectV2/BeatmapDetailsArea.Header.cs @@ -76,6 +76,7 @@ private void load(OsuConfigManager config) { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, + AutoSizeAxes = Axes.X, Text = UserInterfaceStrings.SelectedMods, Height = 30f, // Eyeballed to make spacing match. Because shear is silly and implemented in different ways between dropdown and button. diff --git a/osu.Game/Screens/SelectV2/FilterControl.ScopedBeatmapSetDisplay.cs b/osu.Game/Screens/SelectV2/FilterControl.ScopedBeatmapSetDisplay.cs index 378db5cb2d94..bbe5a1caf1c2 100644 --- a/osu.Game/Screens/SelectV2/FilterControl.ScopedBeatmapSetDisplay.cs +++ b/osu.Game/Screens/SelectV2/FilterControl.ScopedBeatmapSetDisplay.cs @@ -73,10 +73,11 @@ private void load(ISongSelect? songSelect, OverlayColourProvider colourProvider) Colour = colourProvider.Background6, Padding = new MarginPadding { Right = 80, Vertical = 5 } }, - new ShearedButton(80) + new ShearedButton { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, + Width = 80, Text = CommonStrings.Back, RelativeSizeAxes = Axes.Y, Height = 1, diff --git a/osu.Game/Screens/SelectV2/FilterControl.cs b/osu.Game/Screens/SelectV2/FilterControl.cs index 20a55e3e09e3..1853619cb7a8 100644 --- a/osu.Game/Screens/SelectV2/FilterControl.cs +++ b/osu.Game/Screens/SelectV2/FilterControl.cs @@ -152,6 +152,7 @@ private void load(IAPIProvider api) { Anchor = Anchor.Centre, Origin = Anchor.Centre, + AutoSizeAxes = Axes.X, Text = UserInterfaceStrings.ShowConverts, Height = 30f, },