mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-01-01 02:03:32 +00:00
Profile editor - Added layer deleting WIP
This commit is contained in:
parent
5802855eb1
commit
bf1aad1549
@ -209,10 +209,10 @@ public class NotificationButtonBuilder
|
|||||||
internal IControl Build()
|
internal IControl Build()
|
||||||
{
|
{
|
||||||
if (_action != null)
|
if (_action != null)
|
||||||
return new Button {Content = _text, Command = ReactiveCommand.Create(() => _action())};
|
return new Button {Content = _text, Command = ReactiveCommand.Create(() => _action()), Classes = new Classes("AppBarButton")};
|
||||||
if (_command != null)
|
if (_command != null)
|
||||||
return new Button {Content = _text, Command = _command, CommandParameter = _commandParameter};
|
return new Button {Content = _text, Command = _command, CommandParameter = _commandParameter, Classes = new Classes("AppBarButton")};
|
||||||
return new Button {Content = _text};
|
return new Button {Content = _text, Classes = new Classes("AppBarButton")};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,10 +14,10 @@
|
|||||||
</TreeView.Styles>
|
</TreeView.Styles>
|
||||||
<TreeView.KeyBindings>
|
<TreeView.KeyBindings>
|
||||||
<KeyBinding Gesture="F2" Command="{Binding SelectedChild.Rename}" />
|
<KeyBinding Gesture="F2" Command="{Binding SelectedChild.Rename}" />
|
||||||
<KeyBinding Gesture="Delete" Command="{Binding Delete}" CommandParameter="{Binding SelectedTreeItem}" />
|
<KeyBinding Gesture="Delete" Command="{Binding SelectedChild.Delete}" />
|
||||||
<KeyBinding Gesture="Ctrl+D" Command="{Binding Duplicate}" CommandParameter="{Binding SelectedTreeItem}" />
|
<KeyBinding Gesture="Ctrl+D" Command="{Binding SelectedChild.Duplicate}" />
|
||||||
<KeyBinding Gesture="Ctrl+C" Command="{Binding Copy}" CommandParameter="{Binding SelectedTreeItem}" />
|
<KeyBinding Gesture="Ctrl+C" Command="{Binding SelectedChild.Copy}" />
|
||||||
<KeyBinding Gesture="Ctrl+V" Command="{Binding Paste}" CommandParameter="{Binding SelectedTreeItem}" />
|
<KeyBinding Gesture="Ctrl+V" Command="{Binding SelectedChild.Paste}" />
|
||||||
</TreeView.KeyBindings>
|
</TreeView.KeyBindings>
|
||||||
<TreeView.ItemTemplate>
|
<TreeView.ItemTemplate>
|
||||||
<TreeDataTemplate ItemsSource="{Binding Children}">
|
<TreeDataTemplate ItemsSource="{Binding Children}">
|
||||||
@ -35,12 +35,12 @@
|
|||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem Header="Duplicate" Command="{Binding Duplicate}" InputGesture="Ctrl+D" IsEnabled="False">
|
<MenuItem Header="Duplicate" Command="{Binding Duplicate}" InputGesture="Ctrl+D">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<avalonia:MaterialIcon Kind="ContentDuplicate" />
|
<avalonia:MaterialIcon Kind="ContentDuplicate" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Copy" Command="{Binding Copy}" InputGesture="Ctrl+C" IsEnabled="False">
|
<MenuItem Header="Copy" Command="{Binding Copy}" InputGesture="Ctrl+C">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<avalonia:MaterialIcon Kind="ContentCopy" />
|
<avalonia:MaterialIcon Kind="ContentCopy" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
@ -56,7 +56,7 @@
|
|||||||
<avalonia:MaterialIcon Kind="RenameBox" />
|
<avalonia:MaterialIcon Kind="RenameBox" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Delete" Command="{Binding Delete}" InputGesture="Delete" IsEnabled="False">
|
<MenuItem Header="Delete" Command="{Binding Delete}" InputGesture="Delete">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<avalonia:MaterialIcon Kind="TrashCan" />
|
<avalonia:MaterialIcon Kind="TrashCan" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
|
|||||||
@ -59,6 +59,12 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
|
|||||||
RenameValue = ProfileElement?.Name;
|
RenameValue = ProfileElement?.Name;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Delete = ReactiveCommand.Create(() =>
|
||||||
|
{
|
||||||
|
if (ProfileElement is RenderProfileElement renderProfileElement)
|
||||||
|
profileEditorService.ExecuteCommand(new RemoveProfileElement(renderProfileElement));
|
||||||
|
});
|
||||||
|
|
||||||
this.WhenActivated(d =>
|
this.WhenActivated(d =>
|
||||||
{
|
{
|
||||||
_profileEditorService.ProfileElement.Subscribe(element => _currentProfileElement = element).DisposeWith(d);
|
_profileEditorService.ProfileElement.Subscribe(element => _currentProfileElement = element).DisposeWith(d);
|
||||||
@ -91,6 +97,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
|
|||||||
public ReactiveCommand<Unit, Unit> AddLayer { get; }
|
public ReactiveCommand<Unit, Unit> AddLayer { get; }
|
||||||
public ReactiveCommand<Unit, Unit> AddFolder { get; }
|
public ReactiveCommand<Unit, Unit> AddFolder { get; }
|
||||||
public ReactiveCommand<Unit, Unit> Rename { get; }
|
public ReactiveCommand<Unit, Unit> Rename { get; }
|
||||||
|
public ReactiveCommand<Unit, Unit> Delete { get; }
|
||||||
|
|
||||||
public string? RenameValue
|
public string? RenameValue
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user