Add color picker option to accept changes on dismissal
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user