|
@@ -1,9 +1,11 @@
|
|
-using Avalonia.Input;
|
|
|
|
|
|
+using System.Drawing;
|
|
|
|
+using Avalonia.Input;
|
|
using PixiEditor.AvaloniaUI.Models.Commands.Attributes.Commands;
|
|
using PixiEditor.AvaloniaUI.Models.Commands.Attributes.Commands;
|
|
using PixiEditor.AvaloniaUI.Models.Commands.Attributes.Evaluators;
|
|
using PixiEditor.AvaloniaUI.Models.Commands.Attributes.Evaluators;
|
|
using PixiEditor.ChangeableDocument.Enums;
|
|
using PixiEditor.ChangeableDocument.Enums;
|
|
using PixiEditor.DrawingApi.Core.Numerics;
|
|
using PixiEditor.DrawingApi.Core.Numerics;
|
|
using PixiEditor.Numerics;
|
|
using PixiEditor.Numerics;
|
|
|
|
+using PixiEditor.UI.Common.Fonts;
|
|
|
|
|
|
namespace PixiEditor.AvaloniaUI.ViewModels.SubViewModels;
|
|
namespace PixiEditor.AvaloniaUI.ViewModels.SubViewModels;
|
|
|
|
|
|
@@ -16,7 +18,7 @@ internal class SelectionViewModel : SubViewModel<ViewModelMain>
|
|
}
|
|
}
|
|
|
|
|
|
[Command.Basic("PixiEditor.Selection.SelectAll", "SELECT_ALL", "SELECT_ALL_DESCRIPTIVE", CanExecute = "PixiEditor.HasDocument", Key = Key.A, Modifiers = KeyModifiers.Control,
|
|
[Command.Basic("PixiEditor.Selection.SelectAll", "SELECT_ALL", "SELECT_ALL_DESCRIPTIVE", CanExecute = "PixiEditor.HasDocument", Key = Key.A, Modifiers = KeyModifiers.Control,
|
|
- MenuItemPath = "SELECT/SELECT_ALL", MenuItemOrder = 8)]
|
|
|
|
|
|
+ MenuItemPath = "SELECT/SELECT_ALL", MenuItemOrder = 8, Icon = PixiPerfectIcons.SelectAll)]
|
|
public void SelectAll()
|
|
public void SelectAll()
|
|
{
|
|
{
|
|
var doc = Owner.DocumentManagerSubViewModel.ActiveDocument;
|
|
var doc = Owner.DocumentManagerSubViewModel.ActiveDocument;
|
|
@@ -26,7 +28,7 @@ internal class SelectionViewModel : SubViewModel<ViewModelMain>
|
|
}
|
|
}
|
|
|
|
|
|
[Command.Basic("PixiEditor.Selection.Clear", "CLEAR_SELECTION", "CLEAR_SELECTION", CanExecute = "PixiEditor.Selection.IsNotEmpty", Key = Key.D, Modifiers = KeyModifiers.Control,
|
|
[Command.Basic("PixiEditor.Selection.Clear", "CLEAR_SELECTION", "CLEAR_SELECTION", CanExecute = "PixiEditor.Selection.IsNotEmpty", Key = Key.D, Modifiers = KeyModifiers.Control,
|
|
- MenuItemPath = "SELECT/DESELECT", MenuItemOrder = 9)]
|
|
|
|
|
|
+ MenuItemPath = "SELECT/DESELECT", MenuItemOrder = 9, Icon = PixiPerfectIcons.Deselect)]
|
|
public void ClearSelection()
|
|
public void ClearSelection()
|
|
{
|
|
{
|
|
var doc = Owner.DocumentManagerSubViewModel.ActiveDocument;
|
|
var doc = Owner.DocumentManagerSubViewModel.ActiveDocument;
|
|
@@ -36,7 +38,7 @@ internal class SelectionViewModel : SubViewModel<ViewModelMain>
|
|
}
|
|
}
|
|
|
|
|
|
[Command.Basic("PixiEditor.Selection.InvertSelection", "INVERT_SELECTION", "INVERT_SELECTION_DESCRIPTIVE", CanExecute = "PixiEditor.Selection.IsNotEmpty", Key = Key.I, Modifiers = KeyModifiers.Control,
|
|
[Command.Basic("PixiEditor.Selection.InvertSelection", "INVERT_SELECTION", "INVERT_SELECTION_DESCRIPTIVE", CanExecute = "PixiEditor.Selection.IsNotEmpty", Key = Key.I, Modifiers = KeyModifiers.Control,
|
|
- MenuItemPath = "SELECT/INVERT", MenuItemOrder = 10)]
|
|
|
|
|
|
+ MenuItemPath = "SELECT/INVERT", MenuItemOrder = 10, Icon = PixiPerfectIcons.Invert)]
|
|
public void InvertSelection()
|
|
public void InvertSelection()
|
|
{
|
|
{
|
|
Owner.DocumentManagerSubViewModel.ActiveDocument?.Operations.InvertSelection();
|
|
Owner.DocumentManagerSubViewModel.ActiveDocument?.Operations.InvertSelection();
|
|
@@ -54,7 +56,8 @@ internal class SelectionViewModel : SubViewModel<ViewModelMain>
|
|
return SelectionIsNotEmpty() && (Owner.DocumentManagerSubViewModel.ActiveDocument?.SelectedStructureMember?.HasMaskBindable ?? false);
|
|
return SelectionIsNotEmpty() && (Owner.DocumentManagerSubViewModel.ActiveDocument?.SelectedStructureMember?.HasMaskBindable ?? false);
|
|
}
|
|
}
|
|
|
|
|
|
- [Command.Basic("PixiEditor.Selection.TransformArea", "TRANSFORM_SELECTED_AREA", "TRANSFORM_SELECTED_AREA", CanExecute = "PixiEditor.Selection.IsNotEmpty", Key = Key.T, Modifiers = KeyModifiers.Control)]
|
|
|
|
|
|
+ [Command.Basic("PixiEditor.Selection.TransformArea", "TRANSFORM_SELECTED_AREA", "TRANSFORM_SELECTED_AREA", CanExecute = "PixiEditor.Selection.IsNotEmpty",
|
|
|
|
+ Key = Key.T, Modifiers = KeyModifiers.Control)]
|
|
public void TransformSelectedArea()
|
|
public void TransformSelectedArea()
|
|
{
|
|
{
|
|
Owner.DocumentManagerSubViewModel.ActiveDocument?.Operations.TransformSelectedArea(false);
|
|
Owner.DocumentManagerSubViewModel.ActiveDocument?.Operations.TransformSelectedArea(false);
|
|
@@ -71,13 +74,13 @@ internal class SelectionViewModel : SubViewModel<ViewModelMain>
|
|
}
|
|
}
|
|
|
|
|
|
[Command.Basic("PixiEditor.Selection.NewToMask", SelectionMode.New, "MASK_FROM_SELECTION", "MASK_FROM_SELECTION_DESCRIPTIVE", CanExecute = "PixiEditor.Selection.IsNotEmpty",
|
|
[Command.Basic("PixiEditor.Selection.NewToMask", SelectionMode.New, "MASK_FROM_SELECTION", "MASK_FROM_SELECTION_DESCRIPTIVE", CanExecute = "PixiEditor.Selection.IsNotEmpty",
|
|
- MenuItemPath = "SELECT/SELECTION_TO_MASK/TO_NEW_MASK", MenuItemOrder = 12)]
|
|
|
|
|
|
+ MenuItemPath = "SELECT/SELECTION_TO_MASK/TO_NEW_MASK", MenuItemOrder = 12, Icon = PixiPerfectIcons.NewMask)]
|
|
[Command.Basic("PixiEditor.Selection.AddToMask", SelectionMode.Add, "ADD_SELECTION_TO_MASK", "ADD_SELECTION_TO_MASK", CanExecute = "PixiEditor.Selection.IsNotEmpty",
|
|
[Command.Basic("PixiEditor.Selection.AddToMask", SelectionMode.Add, "ADD_SELECTION_TO_MASK", "ADD_SELECTION_TO_MASK", CanExecute = "PixiEditor.Selection.IsNotEmpty",
|
|
- MenuItemPath = "SELECT/SELECTION_TO_MASK/ADD_TO_MASK", MenuItemOrder = 13)]
|
|
|
|
|
|
+ MenuItemPath = "SELECT/SELECTION_TO_MASK/ADD_TO_MASK", MenuItemOrder = 13, Icon = PixiPerfectIcons.AddToMask)]
|
|
[Command.Basic("PixiEditor.Selection.SubtractFromMask", SelectionMode.Subtract, "SUBTRACT_SELECTION_FROM_MASK", "SUBTRACT_SELECTION_FROM_MASK", CanExecute = "PixiEditor.Selection.IsNotEmptyAndHasMask",
|
|
[Command.Basic("PixiEditor.Selection.SubtractFromMask", SelectionMode.Subtract, "SUBTRACT_SELECTION_FROM_MASK", "SUBTRACT_SELECTION_FROM_MASK", CanExecute = "PixiEditor.Selection.IsNotEmptyAndHasMask",
|
|
- MenuItemPath = "SELECT/SELECTION_TO_MASK/SUBTRACT_FROM_MASK", MenuItemOrder = 14)]
|
|
|
|
|
|
+ MenuItemPath = "SELECT/SELECTION_TO_MASK/SUBTRACT_FROM_MASK", MenuItemOrder = 14, Icon = PixiPerfectIcons.Subtract)]
|
|
[Command.Basic("PixiEditor.Selection.IntersectSelectionMask", SelectionMode.Intersect, "INTERSECT_SELECTION_MASK", "INTERSECT_SELECTION_MASK", CanExecute = "PixiEditor.Selection.IsNotEmptyAndHasMask",
|
|
[Command.Basic("PixiEditor.Selection.IntersectSelectionMask", SelectionMode.Intersect, "INTERSECT_SELECTION_MASK", "INTERSECT_SELECTION_MASK", CanExecute = "PixiEditor.Selection.IsNotEmptyAndHasMask",
|
|
- MenuItemPath = "SELECT/SELECTION_TO_MASK/INTERSECT_WITH_MASK", MenuItemOrder = 15)]
|
|
|
|
|
|
+ MenuItemPath = "SELECT/SELECTION_TO_MASK/INTERSECT_WITH_MASK", MenuItemOrder = 15, Icon = PixiPerfectIcons.Intersect)]
|
|
[Command.Filter("PixiEditor.Selection.ToMaskMenu", "SELECTION_TO_MASK", "SELECTION_TO_MASK", Key = Key.M, Modifiers = KeyModifiers.Control)]
|
|
[Command.Filter("PixiEditor.Selection.ToMaskMenu", "SELECTION_TO_MASK", "SELECTION_TO_MASK", Key = Key.M, Modifiers = KeyModifiers.Control)]
|
|
public void SelectionToMask(SelectionMode mode)
|
|
public void SelectionToMask(SelectionMode mode)
|
|
{
|
|
{
|
|
@@ -85,7 +88,7 @@ internal class SelectionViewModel : SubViewModel<ViewModelMain>
|
|
}
|
|
}
|
|
|
|
|
|
[Command.Basic("PixiEditor.Selection.CropToSelection", "CROP_TO_SELECTION", "CROP_TO_SELECTION_DESCRIPTIVE", CanExecute = "PixiEditor.Selection.IsNotEmpty",
|
|
[Command.Basic("PixiEditor.Selection.CropToSelection", "CROP_TO_SELECTION", "CROP_TO_SELECTION_DESCRIPTIVE", CanExecute = "PixiEditor.Selection.IsNotEmpty",
|
|
- MenuItemPath = "SELECT/CROP_TO_SELECTION", MenuItemOrder = 11)]
|
|
|
|
|
|
+ MenuItemPath = "SELECT/CROP_TO_SELECTION", MenuItemOrder = 11, Icon = PixiPerfectIcons.CropToSelection)]
|
|
public void CropToSelection()
|
|
public void CropToSelection()
|
|
{
|
|
{
|
|
var document = Owner.DocumentManagerSubViewModel.ActiveDocument;
|
|
var document = Owner.DocumentManagerSubViewModel.ActiveDocument;
|