Change inheritance of selection box buttons to base control instead

This commit is contained in:
Salman Ahmed
2021-04-24 07:46:38 +03:00
parent decd8803bc
commit 4bfa9cd6b6

View File

@ -12,10 +12,7 @@ using osuTK.Graphics;
namespace osu.Game.Screens.Edit.Compose.Components namespace osu.Game.Screens.Edit.Compose.Components
{ {
/// <summary> public sealed class SelectionBoxButton : SelectionBoxControl, IHasTooltip
/// A drag "handle" which shares the visual appearance but behaves more like a clickable button.
/// </summary>
public sealed class SelectionBoxDragHandleButton : SelectionBoxDragHandle, IHasTooltip
{ {
private SpriteIcon icon; private SpriteIcon icon;
@ -23,7 +20,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
public Action Action; public Action Action;
public SelectionBoxDragHandleButton(IconUsage iconUsage, string tooltip) public SelectionBoxButton(IconUsage iconUsage, string tooltip)
{ {
this.iconUsage = iconUsage; this.iconUsage = iconUsage;
@ -36,7 +33,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
Size *= 2; Size = new Vector2(20);
AddInternal(icon = new SpriteIcon AddInternal(icon = new SpriteIcon
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -49,9 +46,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
protected override bool OnClick(ClickEvent e) protected override bool OnClick(ClickEvent e)
{ {
OperationStarted?.Invoke(); OnOperationStarted();
Action?.Invoke(); Action?.Invoke();
OperationEnded?.Invoke(); OnOperationEnded();
return true; return true;
} }