mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Profile editor - Don't confirm when deleting layers (we have undo)
Profile editor - Apply new brushes before saving to fix undo crash
This commit is contained in:
parent
7ffe8f3e5b
commit
3792dd53d2
@ -136,19 +136,16 @@ namespace Artemis.UI.Shared
|
|||||||
Validate();
|
Validate();
|
||||||
// Only apply the input value to the layer property if the validator found no errors
|
// Only apply the input value to the layer property if the validator found no errors
|
||||||
if (!HasErrors)
|
if (!HasErrors)
|
||||||
SetCurrentValue(_inputValue, !InputDragging);
|
{
|
||||||
|
OnInputValueChanged();
|
||||||
|
LayerProperty.SetCurrentValue(_inputValue, ProfileEditorService.CurrentTime);
|
||||||
|
OnInputValueApplied();
|
||||||
|
|
||||||
OnInputValueChanged();
|
if (InputDragging)
|
||||||
OnInputValueApplied();
|
ProfileEditorService.UpdateProfilePreview();
|
||||||
}
|
else
|
||||||
|
ProfileEditorService.UpdateSelectedProfileElement();
|
||||||
private void SetCurrentValue(T value, bool saveChanges)
|
}
|
||||||
{
|
|
||||||
LayerProperty.SetCurrentValue(value, ProfileEditorService.CurrentTime);
|
|
||||||
if (saveChanges)
|
|
||||||
ProfileEditorService.UpdateSelectedProfileElement();
|
|
||||||
else
|
|
||||||
ProfileEditorService.UpdateProfilePreview();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateInputValue()
|
private void UpdateInputValue()
|
||||||
|
|||||||
@ -167,18 +167,8 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once UnusedMember.Global - Called from view
|
public void DeleteElement()
|
||||||
public async Task DeleteElement()
|
|
||||||
{
|
{
|
||||||
bool result = await _dialogService.ShowConfirmDialogAt(
|
|
||||||
"ProfileTreeDialog",
|
|
||||||
"Delete profile element",
|
|
||||||
"Are you sure?"
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!result)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ProfileElement newSelection = null;
|
ProfileElement newSelection = null;
|
||||||
if (ProfileElement.Parent != null)
|
if (ProfileElement.Parent != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user