mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Gradient picker - Properly react to gradient changes once again
This commit is contained in:
1 parent
b342eabe4d
commit
2bc882c814
4 files changed
+40
-19
No files matched your search
+8
-7
@@ -73,7 +73,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings.DirectDa
|
||||
Modifier.DirectDataBinding.RemoveModifier(Modifier);
|
||||
_profileEditorService.UpdateSelectedProfileElement();
|
||||
}
|
||||
|
||||
|
||||
private void ParameterSelectionViewModelOnPropertySelected(object sender, DataModelInputDynamicEventArgs e)
|
||||
{
|
||||
Modifier.UpdateParameterDynamic(e.DataModelPath);
|
||||
@@ -139,13 +139,8 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings.DirectDa
|
||||
// Parameter
|
||||
if (DynamicSelectionViewModel != null)
|
||||
DynamicSelectionViewModel.ChangeDataModelPath(Modifier.ParameterPath);
|
||||
else if (StaticInputViewModel != null)
|
||||
{
|
||||
// Ensure the right static value is never null when the preferred type is a value type
|
||||
else if (StaticInputViewModel != null)
|
||||
StaticInputViewModel.Value = Modifier.ParameterStaticValue;
|
||||
if (SelectedModifierType.ParameterType.IsValueType && StaticInputViewModel.Value == null)
|
||||
StaticInputViewModel.Value = SelectedModifierType.ParameterType.GetDefault();
|
||||
}
|
||||
}
|
||||
|
||||
private void ExecuteSelectModifierTypeCommand(object context)
|
||||
@@ -197,6 +192,12 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings.DirectDa
|
||||
private void DynamicSelectionViewModelOnSwitchToStaticRequested(object sender, EventArgs e)
|
||||
{
|
||||
Modifier.ParameterType = ProfileRightSideType.Static;
|
||||
|
||||
// Ensure the right static value is never null when the preferred type is a value type
|
||||
if (SelectedModifierType.ParameterType != null &&
|
||||
SelectedModifierType.ParameterType.IsValueType && Modifier.ParameterStaticValue == null)
|
||||
Modifier.UpdateParameterStatic(SelectedModifierType.ParameterType.GetDefault());
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user