mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +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>();
|
_leds = new List<ArtemisLed>();
|
||||||
|
|
||||||
Initialize();
|
Initialize();
|
||||||
Parent.AddChild(this);
|
Parent.AddChild(this, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -120,7 +120,7 @@ namespace Artemis.Core
|
|||||||
#region Hierarchy
|
#region Hierarchy
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
/// <param name="child">The profile element to add</param>
|
/// <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>
|
/// <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
|
PluginSetting<LayerBrushReference> defaultReference = _settingsService.GetSetting("ProfileEditor.DefaultLayerBrushDescriptor", new LayerBrushReference
|
||||||
{
|
{
|
||||||
LayerBrushProviderId = "Artemis.Plugins.LayerBrushes.Color.ColorBrushProvider-92a9d6ba",
|
LayerBrushProviderId = "Artemis.Plugins.LayerBrushes.Color.ColorBrushProvider-92a9d6ba",
|
||||||
BrushType = "ColorBrush"
|
BrushType = "SolidBrush"
|
||||||
});
|
});
|
||||||
|
|
||||||
defaultReference.Value.LayerBrushProviderId ??= "Artemis.Plugins.LayerBrushes.Color.ColorBrushProvider-92a9d6ba";
|
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;
|
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
|
// If the selected item is a parent of this model - expand
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool isParentOfModel = HierarchyPredicate?.Invoke(SelectedItem, model) ?? true;
|
bool isParentOfModel = HierarchyPredicate?.Invoke(SelectedItem, model) ?? false;
|
||||||
if (isParentOfModel)
|
if (isParentOfModel)
|
||||||
item.IsExpanded = true;
|
item.IsExpanded = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,7 @@
|
|||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</TreeView.ContextMenu>
|
</TreeView.ContextMenu>
|
||||||
<b:Interaction.Behaviors>
|
<b:Interaction.Behaviors>
|
||||||
<behaviors:TreeViewSelectionBehavior ExpandSelected="True" SelectedItem="{Binding SelectedTreeItem}" />
|
<behaviors:TreeViewSelectionBehavior SelectedItem="{Binding SelectedTreeItem}" />
|
||||||
</b:Interaction.Behaviors>
|
</b:Interaction.Behaviors>
|
||||||
<TreeView.Resources>
|
<TreeView.Resources>
|
||||||
<HierarchicalDataTemplate DataType="{x:Type treeItem:FolderViewModel}" ItemsSource="{Binding Items}">
|
<HierarchicalDataTemplate DataType="{x:Type treeItem:FolderViewModel}" ItemsSource="{Binding Items}">
|
||||||
|
|||||||
@ -216,7 +216,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
|
|||||||
public void PasteElement()
|
public void PasteElement()
|
||||||
{
|
{
|
||||||
if (ProfileElement.Parent is Folder parent)
|
if (ProfileElement.Parent is Folder parent)
|
||||||
_profileEditorService.PasteProfileElement(parent, ProfileElement.Order);
|
_profileEditorService.PasteProfileElement(parent, ProfileElement.Order - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateProfileElements()
|
public void UpdateProfileElements()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user