Added a change in cursor type to assist in UX for resizing editor panels and changing the values in value boxes

This commit is contained in:
Chandler Cox
2022-09-30 19:25:50 -05:00
parent 76a66cf400
commit c19ff9b2ef
2 changed files with 21 additions and 0 deletions

View File

@@ -172,6 +172,7 @@ namespace FlaxEditor.GUI.Input
{
_isSliding = false;
EndMouseCapture();
Cursor = CursorType.Default;
SlidingEnd?.Invoke();
}
@@ -236,6 +237,7 @@ namespace FlaxEditor.GUI.Input
_startSlideLocation = location;
_startSlideValue = _value;
StartMouseCapture(true);
Cursor = CursorType.SizeWE;
SlidingStart?.Invoke();
return true;
}
@@ -256,6 +258,16 @@ namespace FlaxEditor.GUI.Input
ApplySliding(Mathf.RoundToInt(slideLocation.X - _startSlideLocation.X) * _slideSpeed);
return;
}
// Update cursor type so user knows they can slide value
if (CanUseSliding && SlideRect.Contains(location))
{
Cursor = CursorType.SizeWE;
}
else if (!_isSliding)
{
Cursor = CursorType.Default;
}
base.OnMouseMove(location);
}