Allows user to left click to end editing text and right click to change text back to its original and end editing.

This commit is contained in:
Chandler Cox
2022-11-29 21:30:17 -06:00
parent 5a50656249
commit 9b82860154
3 changed files with 30 additions and 0 deletions

View File

@@ -371,6 +371,7 @@ namespace FlaxEditor.GUI.Input
Parent = this,
Location = new Float2(split, 0),
Size = new Float2(Height, TextBoxSize),
CanEndEditByClick = true,
};
_textBox.EditEnd += OnTextBoxEditEnd;
}

View File

@@ -125,6 +125,7 @@ namespace FlaxEditor.GUI.Input
_min = min;
_max = max;
_slideSpeed = sliderSpeed;
CanEndEditByClick = true;
}
/// <summary>
@@ -173,6 +174,7 @@ namespace FlaxEditor.GUI.Input
private void EndSliding()
{
_isSliding = false;
CanEndEditByClick = true;
EndMouseCapture();
if (_cursorChanged)
{
@@ -245,6 +247,7 @@ namespace FlaxEditor.GUI.Input
_startSlideLocation = location;
_startSlideValue = _value;
StartMouseCapture(true);
CanEndEditByClick = false;
// Hide cursor and cache location
Cursor = CursorType.Hidden;