Cleanup and improve code from #1109

This commit is contained in:
Wojtek Figat
2023-05-28 16:12:32 +02:00
parent 9cdd1cbc45
commit 62946f6359
14 changed files with 212 additions and 400 deletions

View File

@@ -57,6 +57,11 @@ namespace FlaxEditor.GUI.Input
/// </summary>
protected Color _value;
/// <summary>
/// Enables live preview of the selected value from the picker. Otherwise will update the value only when user confirms it on dialog closing.
/// </summary>
public bool UseDynamicEditing = true;
/// <summary>
/// Occurs when value gets changed.
/// </summary>
@@ -143,7 +148,7 @@ namespace FlaxEditor.GUI.Input
base.OnSubmit();
// Show color picker dialog
_currentDialog = ShowPickColorDialog?.Invoke(this, _value, OnColorChanged, OnPickerClosed);
_currentDialog = ShowPickColorDialog?.Invoke(this, _value, OnColorChanged, OnPickerClosed, UseDynamicEditing);
}
private void OnColorChanged(Color color, bool sliding)