@@ -49,6 +49,11 @@ namespace FlaxEditor.GUI.Input
|
||||
/// </summary>
|
||||
protected T _startSlideValue;
|
||||
|
||||
/// <summary>
|
||||
/// The text cached on editing start. Used to compare with the end result to detect changes.
|
||||
/// </summary>
|
||||
protected string _startEditText;
|
||||
|
||||
private Vector2 _startSlideLocation;
|
||||
|
||||
/// <summary>
|
||||
@@ -257,11 +262,23 @@ namespace FlaxEditor.GUI.Input
|
||||
return base.OnMouseUp(location, button);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnEditBegin()
|
||||
{
|
||||
base.OnEditBegin();
|
||||
|
||||
_startEditText = _text;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnEditEnd()
|
||||
{
|
||||
// Update value
|
||||
TryGetValue();
|
||||
if (_startEditText != _text)
|
||||
{
|
||||
// Update value
|
||||
TryGetValue();
|
||||
}
|
||||
_startEditText = null;
|
||||
|
||||
base.OnEditEnd();
|
||||
}
|
||||
|
||||
@@ -942,6 +942,8 @@ namespace FlaxEngine.GUI
|
||||
{
|
||||
base.OnLostFocus();
|
||||
|
||||
if (IsReadOnly)
|
||||
return;
|
||||
OnEditEnd();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user