1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Profile editor - Profile tree ordering fixes

Profile editor - Add new layers on top again
Profile editor - Don't willy nilly expand folders
This commit is contained in:
Robert 2020-12-10 20:43:03 +01:00
parent 9480cf5c32
commit 1b737b4211
6 changed files with 7 additions and 7 deletions

View File

@ -42,7 +42,7 @@ namespace Artemis.Core
_leds = new List<ArtemisLed>();
Initialize();
Parent.AddChild(this);
Parent.AddChild(this, 0);
}
/// <summary>

View File

@ -120,7 +120,7 @@ namespace Artemis.Core
#region Hierarchy
/// <summary>
/// Adds a profile element to the <see cref="Children" /> collection, optionally at the given position (1-based)
/// Adds a profile element to the <see cref="Children" /> collection, optionally at the given position (0-based)
/// </summary>
/// <param name="child">The profile element to add</param>
/// <param name="order">The order where to place the child (0-based), defaults to the end of the collection</param>

View File

@ -39,11 +39,11 @@ namespace Artemis.Core.Services
PluginSetting<LayerBrushReference> defaultReference = _settingsService.GetSetting("ProfileEditor.DefaultLayerBrushDescriptor", new LayerBrushReference
{
LayerBrushProviderId = "Artemis.Plugins.LayerBrushes.Color.ColorBrushProvider-92a9d6ba",
BrushType = "ColorBrush"
BrushType = "SolidBrush"
});
defaultReference.Value.LayerBrushProviderId ??= "Artemis.Plugins.LayerBrushes.Color.ColorBrushProvider-92a9d6ba";
defaultReference.Value.BrushType ??= "ColorBrush";
defaultReference.Value.BrushType ??= "SolidBrush";
return LayerBrushStore.Get(defaultReference.Value.LayerBrushProviderId, defaultReference.Value.BrushType)?.LayerBrushDescriptor;
}
}

View File

@ -119,7 +119,7 @@ namespace Artemis.UI.Behaviors
// If the selected item is a parent of this model - expand
else
{
bool isParentOfModel = HierarchyPredicate?.Invoke(SelectedItem, model) ?? true;
bool isParentOfModel = HierarchyPredicate?.Invoke(SelectedItem, model) ?? false;
if (isParentOfModel)
item.IsExpanded = true;
}

View File

@ -83,7 +83,7 @@
</ContextMenu>
</TreeView.ContextMenu>
<b:Interaction.Behaviors>
<behaviors:TreeViewSelectionBehavior ExpandSelected="True" SelectedItem="{Binding SelectedTreeItem}" />
<behaviors:TreeViewSelectionBehavior SelectedItem="{Binding SelectedTreeItem}" />
</b:Interaction.Behaviors>
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type treeItem:FolderViewModel}" ItemsSource="{Binding Items}">

View File

@ -216,7 +216,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
public void PasteElement()
{
if (ProfileElement.Parent is Folder parent)
_profileEditorService.PasteProfileElement(parent, ProfileElement.Order);
_profileEditorService.PasteProfileElement(parent, ProfileElement.Order - 1);
}
public void UpdateProfileElements()