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:
parent
9480cf5c32
commit
1b737b4211
@ -42,7 +42,7 @@ namespace Artemis.Core
|
||||
_leds = new List<ArtemisLed>();
|
||||
|
||||
Initialize();
|
||||
Parent.AddChild(this);
|
||||
Parent.AddChild(this, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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}">
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user