1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 17:27:39 +08:00

Move selection box control internal events to drag handles

This commit is contained in:
Salman Ahmed 2021-05-04 06:37:18 +03:00
parent fd7a6b3a7c
commit 5f33c3514e
2 changed files with 20 additions and 7 deletions

View File

@ -22,9 +22,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
public event Action OperationStarted;
public event Action OperationEnded;
internal event Action HoverGained;
internal event Action HoverLost;
private Circle circle;
/// <summary>
@ -62,14 +59,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
protected override bool OnHover(HoverEvent e)
{
UpdateHoverState();
HoverGained?.Invoke();
return true;
}
protected override void OnHoverLost(HoverLostEvent e)
{
base.OnHoverLost(e);
HoverLost?.Invoke();
UpdateHoverState();
}
@ -89,7 +83,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
HandlingMouse = false;
UpdateHoverState();
base.OnMouseUp(e);
}
protected virtual void UpdateHoverState()

View File

@ -29,5 +29,25 @@ namespace osu.Game.Screens.Edit.Compose.Components
UpdateHoverState();
base.OnDragEnd(e);
}
#region Internal events for SelectionBoxDragHandleContainer
internal event Action HoverGained;
internal event Action HoverLost;
protected override bool OnHover(HoverEvent e)
{
bool result = base.OnHover(e);
HoverGained?.Invoke();
return result;
}
protected override void OnHoverLost(HoverLostEvent e)
{
base.OnHoverLost(e);
HoverLost?.Invoke();
}
#endregion
}
}