Conditions - Removed animations that made the UI feel sluggish

Profile editor - Fixed effects toggle sometimes dissapearing
Property tree - Replaced TreeView with custom implementation
Property tree - Fixed minus/plus numpad keys collapsing the tree
This commit is contained in:
Robert committed 2020-09-25 20:19:53 +02:00
1 parent fa329a9048
commit a5455c26d6
17 files changed
+430 -447

No files matched your search

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using Artemis.Core;
using Artemis.Core.LayerBrushes;
@@ -36,6 +37,8 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
LayerPropertyGroupViewModel = layerPropertyGroupViewModel;
LayerPropertyGroup = LayerPropertyGroupViewModel.LayerPropertyGroup;
LayerPropertyGroupViewModel.PropertyChanged += LayerPropertyGroupViewModelOnPropertyChanged;
DetermineGroupType();
}
@@ -43,6 +46,11 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
public LayerPropertyGroup LayerPropertyGroup { get; }
public LayerPropertyGroupType GroupType { get; set; }
public BindableCollection<PropertyChangedBase> Children =>
LayerPropertyGroupViewModel.IsExpanded && LayerPropertyGroupViewModel.IsVisible
? LayerPropertyGroupViewModel.Children
: null;
public void OpenBrushSettings()
{
var layerBrush = LayerPropertyGroup.LayerBrush;
@@ -128,6 +136,25 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
_profileEditorService.UpdateSelectedProfile();
}
public double GetDepth()
{
var depth = 0;
var current = LayerPropertyGroup.Parent;
while (current != null)
{
depth++;
current = current.Parent;
}
return depth;
}
private void LayerPropertyGroupViewModelOnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(LayerPropertyGroupViewModel.IsExpanded) || e.PropertyName == nameof(LayerPropertyGroupViewModel.IsVisible))
NotifyOfPropertyChange(nameof(Children));
}
private void DetermineGroupType()
{
if (LayerPropertyGroup is LayerGeneralProperties)