mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +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
+10
-8
@@ -132,16 +132,12 @@ namespace Artemis.UI.Screens.ProfileEditor.Conditions.Abstract
|
||||
DisposeRightSideDynamicViewModel();
|
||||
if (RightSideInputViewModel == null)
|
||||
CreateRightSideInputViewModel();
|
||||
|
||||
|
||||
Type preferredType = DataModelConditionPredicate.GetPreferredRightSideType();
|
||||
// Ensure the right static value is never null when the preferred type is a value type
|
||||
if (preferredType.IsValueType && DataModelConditionPredicate.RightStaticValue == null)
|
||||
RightSideInputViewModel.Value = preferredType.GetDefault();
|
||||
else
|
||||
RightSideInputViewModel.Value = DataModelConditionPredicate.RightStaticValue;
|
||||
|
||||
if (RightSideInputViewModel.TargetType != preferredType)
|
||||
if (preferredType != null && RightSideInputViewModel.TargetType != preferredType)
|
||||
RightSideInputViewModel.UpdateTargetType(preferredType);
|
||||
|
||||
RightSideInputViewModel.Value = DataModelConditionPredicate.RightStaticValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,6 +290,12 @@ namespace Artemis.UI.Screens.ProfileEditor.Conditions.Abstract
|
||||
private void RightSideSelectionViewModelOnSwitchToStaticRequested(object sender, EventArgs e)
|
||||
{
|
||||
DataModelConditionPredicate.PredicateType = ProfileRightSideType.Static;
|
||||
|
||||
// Ensure the right static value is never null when the preferred type is a value type
|
||||
Type preferredType = DataModelConditionPredicate.GetPreferredRightSideType();
|
||||
if (DataModelConditionPredicate.RightStaticValue == null && preferredType != null && preferredType.IsValueType)
|
||||
DataModelConditionPredicate.UpdateRightSideStatic(preferredType.GetDefault());
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user