mirror of
https://github.com/ppy/osu
synced 2025-01-18 20:10:49 +00:00
Move selection box control internal events to drag handles
This commit is contained in:
parent
fd7a6b3a7c
commit
5f33c3514e
@ -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()
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user