Add color picker option to accept changes on dismissal

This commit is contained in:
Edu Garcia
2023-10-07 10:12:37 +01:00
parent a9dd9adc22
commit 2bec653b81
2 changed files with 11 additions and 1 deletions

View File

@@ -362,7 +362,10 @@ namespace FlaxEditor.GUI.Dialogs
_disableEvents = true;
// Restore color if modified
if (_useDynamicEditing && _initialValue != _value)
var options = Editor.Instance.Options.Options;
if (!options.Interface.ColorPickerAlwaysChangesColor &&
_useDynamicEditing && _initialValue != _value)
{
_onChanged?.Invoke(_initialValue, false);
}

View File

@@ -148,6 +148,13 @@ namespace FlaxEditor.Options
[EditorDisplay("Interface"), EditorOrder(280), Tooltip("Editor content window orientation.")]
public FlaxEngine.GUI.Orientation ContentWindowOrientation { get; set; } = FlaxEngine.GUI.Orientation.Horizontal;
/// <summary>
/// Gets or sets the editor content window orientation.
/// </summary>
[DefaultValue(false)]
[EditorDisplay("Interface"), EditorOrder(300), Tooltip("If checked, color pickers will always modify the color unless 'Cancel' if pressed, otherwise color won't change unless 'Ok' is pressed (default)")]
public bool ColorPickerAlwaysChangesColor { get; set; } = false;
/// <summary>
/// Gets or sets the timestamps prefix mode for output log messages.
/// </summary>