|
@@ -163,45 +163,45 @@ namespace PixiEditor.ViewModels
|
|
|
ShortcutController = new ShortcutController(
|
|
|
new ShortcutGroup(
|
|
|
"Tools",
|
|
|
- CreateToolShortcut<PenTool>(Key.B, "Select Pen Tool"),
|
|
|
- CreateToolShortcut<EraserTool>(Key.E, "Select Eraser Tool"),
|
|
|
- CreateToolShortcut<ColorPickerTool>(Key.O, "Select Color Picker Tool"),
|
|
|
- CreateToolShortcut<RectangleTool>(Key.R, "Select Rectangle Tool"),
|
|
|
- CreateToolShortcut<CircleTool>(Key.C, "Select Circle Tool"),
|
|
|
- CreateToolShortcut<LineTool>(Key.L, "Select Line Tool"),
|
|
|
- CreateToolShortcut<FloodFillTool>(Key.G, "Select Flood Fill Tool"),
|
|
|
- CreateToolShortcut<BrightnessTool>(Key.U, "Select Brightness Tool"),
|
|
|
- CreateToolShortcut<MoveTool>(Key.V, "Select Move Tool"),
|
|
|
- CreateToolShortcut<SelectTool>(Key.M, "Select Select Tool"),
|
|
|
- CreateToolShortcut<ZoomTool>(Key.Z, "Select Zoom Tool"),
|
|
|
- CreateToolShortcut<MoveViewportTool>(Key.Space, "Select Viewport Move Tool"),
|
|
|
- CreateToolShortcut<MagicWandTool>(Key.W, "Select Magic Wand Tool"),
|
|
|
+ CreateToolShortcut<PenTool>(Key.B, "Pen"),
|
|
|
+ CreateToolShortcut<EraserTool>(Key.E, "Eraser"),
|
|
|
+ CreateToolShortcut<ColorPickerTool>(Key.O, "Color picker"),
|
|
|
+ CreateToolShortcut<RectangleTool>(Key.R, "Rectangle"),
|
|
|
+ CreateToolShortcut<CircleTool>(Key.C, "Ellipse"),
|
|
|
+ CreateToolShortcut<LineTool>(Key.L, "Line"),
|
|
|
+ CreateToolShortcut<FloodFillTool>(Key.G, "Flood fill"),
|
|
|
+ CreateToolShortcut<BrightnessTool>(Key.U, "Brightness"),
|
|
|
+ CreateToolShortcut<MoveTool>(Key.V, "Move selection"),
|
|
|
+ CreateToolShortcut<SelectTool>(Key.M, "Select"),
|
|
|
+ CreateToolShortcut<ZoomTool>(Key.Z, "Zoom"),
|
|
|
+ CreateToolShortcut<MoveViewportTool>(Key.H, "Move viewport"),
|
|
|
+ CreateToolShortcut<MagicWandTool>(Key.W, "Magic wand"),
|
|
|
new Shortcut(Key.OemPlus, ViewportSubViewModel.ZoomCommand, "Zoom in", 1),
|
|
|
new Shortcut(Key.OemMinus, ViewportSubViewModel.ZoomCommand, "Zoom out", -1),
|
|
|
- new Shortcut(Key.OemOpenBrackets, ToolsSubViewModel.ChangeToolSizeCommand, "Decrease Tool Size", -1),
|
|
|
- new Shortcut(Key.OemCloseBrackets, ToolsSubViewModel.ChangeToolSizeCommand, "Increase Tool Size", 1)),
|
|
|
+ new Shortcut(Key.OemOpenBrackets, ToolsSubViewModel.ChangeToolSizeCommand, "Decrease tool size", -1),
|
|
|
+ new Shortcut(Key.OemCloseBrackets, ToolsSubViewModel.ChangeToolSizeCommand, "Increase tool size", 1)),
|
|
|
new ShortcutGroup(
|
|
|
"Editor",
|
|
|
- new Shortcut(Key.X, ColorsSubViewModel.SwapColorsCommand, "Swap primary and secondary color"),
|
|
|
+ new Shortcut(Key.X, ColorsSubViewModel.SwapColorsCommand, "Swap primary and secondary colors"),
|
|
|
new Shortcut(Key.Y, UndoSubViewModel.RedoCommand, "Redo", modifier: ModifierKeys.Control),
|
|
|
new Shortcut(Key.Z, UndoSubViewModel.UndoCommand, "Undo", modifier: ModifierKeys.Control),
|
|
|
- new Shortcut(Key.D, SelectionSubViewModel.DeselectCommand, "Deselect all command", modifier: ModifierKeys.Control),
|
|
|
- new Shortcut(Key.A, SelectionSubViewModel.SelectAllCommand, "Select all command", modifier: ModifierKeys.Control),
|
|
|
+ new Shortcut(Key.D, SelectionSubViewModel.DeselectCommand, "Clear selection", modifier: ModifierKeys.Control),
|
|
|
+ new Shortcut(Key.A, SelectionSubViewModel.SelectAllCommand, "Select all", modifier: ModifierKeys.Control),
|
|
|
new Shortcut(Key.C, ClipboardSubViewModel.CopyCommand, "Copy", modifier: ModifierKeys.Control),
|
|
|
new Shortcut(Key.V, ClipboardSubViewModel.PasteCommand, "Paste", modifier: ModifierKeys.Control),
|
|
|
new Shortcut(Key.J, ClipboardSubViewModel.DuplicateCommand, "Duplicate", modifier: ModifierKeys.Control),
|
|
|
new Shortcut(Key.X, ClipboardSubViewModel.CutCommand, "Cut", modifier: ModifierKeys.Control),
|
|
|
- new Shortcut(Key.Delete, DocumentSubViewModel.DeletePixelsCommand, "Delete selected pixels"),
|
|
|
- new Shortcut(Key.I, DocumentSubViewModel.OpenResizePopupCommand, "Resize document", modifier: ModifierKeys.Control | ModifierKeys.Shift),
|
|
|
+ new Shortcut(Key.Delete, DocumentSubViewModel.DeletePixelsCommand, "Clear selected area"),
|
|
|
+ new Shortcut(Key.I, DocumentSubViewModel.OpenResizePopupCommand, "Resize image", modifier: ModifierKeys.Control | ModifierKeys.Shift),
|
|
|
new Shortcut(Key.C, DocumentSubViewModel.OpenResizePopupCommand, "Resize canvas", "canvas", ModifierKeys.Control | ModifierKeys.Shift),
|
|
|
- new Shortcut(Key.F11, SystemCommands.MaximizeWindowCommand, "Maximize")),
|
|
|
+ new Shortcut(Key.F11, SystemCommands.MaximizeWindowCommand, "Maximize window")),
|
|
|
new ShortcutGroup(
|
|
|
"File",
|
|
|
- new Shortcut(Key.O, FileSubViewModel.OpenFileCommand, "Open a Document", modifier: ModifierKeys.Control),
|
|
|
- new Shortcut(Key.S, FileSubViewModel.ExportFileCommand, "Export as image", modifier: ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt),
|
|
|
- new Shortcut(Key.S, FileSubViewModel.SaveDocumentCommand, "Save Document", modifier: ModifierKeys.Control),
|
|
|
- new Shortcut(Key.S, FileSubViewModel.SaveDocumentCommand, "Save Document As New", "AsNew", ModifierKeys.Control | ModifierKeys.Shift),
|
|
|
- new Shortcut(Key.N, FileSubViewModel.OpenNewFilePopupCommand, "Create new Document", modifier: ModifierKeys.Control)),
|
|
|
+ new Shortcut(Key.O, FileSubViewModel.OpenFileCommand, "Open image", modifier: ModifierKeys.Control),
|
|
|
+ new Shortcut(Key.S, FileSubViewModel.ExportFileCommand, "Export image", modifier: ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt),
|
|
|
+ new Shortcut(Key.S, FileSubViewModel.SaveDocumentCommand, "Save", modifier: ModifierKeys.Control),
|
|
|
+ new Shortcut(Key.S, FileSubViewModel.SaveDocumentCommand, "Save as new", "AsNew", ModifierKeys.Control | ModifierKeys.Shift),
|
|
|
+ new Shortcut(Key.N, FileSubViewModel.OpenNewFilePopupCommand, "Create new image", modifier: ModifierKeys.Control)),
|
|
|
new ShortcutGroup(
|
|
|
"Layers",
|
|
|
new Shortcut(Key.F2, LayersSubViewModel.RenameLayerCommand, "Rename active layer", BitmapManager.ActiveDocument?.ActiveLayerGuid)),
|
|
@@ -226,9 +226,11 @@ namespace PixiEditor.ViewModels
|
|
|
ShortcutController.ShortcutGroups.Add(
|
|
|
new ShortcutGroup(
|
|
|
"Misc",
|
|
|
- new Shortcut(Key.F1, MiscSubViewModel.OpenShortcutWindowCommand, "Open the shortcut window", true)));
|
|
|
+ new Shortcut(Key.F1, MiscSubViewModel.OpenShortcutWindowCommand, "Open shortcuts window", true)));
|
|
|
|
|
|
BitmapManager.PrimaryColor = ColorsSubViewModel.PrimaryColor;
|
|
|
+
|
|
|
+ ToolsSubViewModel?.SetupToolsTooltipShortcuts(services);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -332,7 +334,7 @@ namespace PixiEditor.ViewModels
|
|
|
|
|
|
if (!BitmapManager.ActiveDocument.ChangesSaved)
|
|
|
{
|
|
|
- result = ConfirmationDialog.Show(DocumentViewModel.ConfirmationDialogMessage);
|
|
|
+ result = ConfirmationDialog.Show(DocumentViewModel.ConfirmationDialogMessage, DocumentViewModel.ConfirmationDialogTitle);
|
|
|
if (result == ConfirmationType.Yes)
|
|
|
{
|
|
|
FileSubViewModel.SaveDocument(false);
|
|
@@ -371,7 +373,7 @@ namespace PixiEditor.ViewModels
|
|
|
|
|
|
private void ActiveDocument_DocumentSizeChanged(object sender, DocumentSizeChangedEventArgs e)
|
|
|
{
|
|
|
- BitmapManager.ActiveDocument.ActiveSelection = new Selection(Array.Empty<Coordinates>());
|
|
|
+ BitmapManager.ActiveDocument.ActiveSelection = new Selection(Array.Empty<Coordinates>(), new PixelSize(e.NewWidth, e.NewHeight));
|
|
|
BitmapManager.ActiveDocument.ChangesSaved = false;
|
|
|
BitmapManager.ActiveDocument.CenterViewportTrigger.Execute(this, new Size(BitmapManager.ActiveDocument.Width, BitmapManager.ActiveDocument.Height));
|
|
|
}
|