1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 13:20:32 +08:00

Reduce abstractions of rounded button

This commit is contained in:
Dean Herbert
2025-11-25 00:55:42 +09:00
Unverified
parent d59e9572d2
commit b0762fc8ec
3 changed files with 14 additions and 22 deletions
@@ -6,7 +6,7 @@ using osu.Game.Graphics.UserInterfaceV2;
namespace osu.Game.Graphics.UserInterface
{
public partial class DangerousRoundedButton : RoundedButton
public sealed partial class DangerousRoundedButton : RoundedButton
{
[BackgroundDependencyLoader]
private void load(OsuColour colours)
@@ -191,8 +191,18 @@ namespace osu.Game.Overlays.Settings.Sections.Input
Spacing = new Vector2(5),
Children = new Drawable[]
{
new CancelButton { Action = () => finalise(false) },
new ClearButton { Action = clear },
new RoundedButton
{
Text = CommonStrings.ButtonsCancel,
Size = new Vector2(80, 20),
Action = () => finalise(false)
},
new DangerousRoundedButton
{
Text = CommonStrings.ButtonsClear,
Size = new Vector2(80, 20),
Action = clear
},
},
},
new HoverClickSounds()
@@ -538,23 +548,5 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{
isDefault.Value = KeyBindings.Select(b => b.KeyCombination).SequenceEqual(Defaults);
}
private partial class CancelButton : RoundedButton
{
public CancelButton()
{
Text = CommonStrings.ButtonsCancel;
Size = new Vector2(80, 20);
}
}
public partial class ClearButton : DangerousRoundedButton
{
public ClearButton()
{
Text = CommonStrings.ButtonsClear;
Size = new Vector2(80, 20);
}
}
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ using osu.Game.Graphics.UserInterfaceV2;
namespace osu.Game.Rulesets.Edit
{
public partial class ExpandableButton : RoundedButton, IExpandable
public sealed partial class ExpandableButton : RoundedButton, IExpandable
{
private float actualHeight;