浏览代码

Merge pull request #46 from PolarJunction/master

Clear Selection when single point is selected. Add MaximiseWindow Shortcut. Add Exit to File Menu
Krzysztof Krysiński 5 年之前
父节点
当前提交
24ee1159cd

+ 6 - 0
PixiEditor/Models/Tools/Tools/SelectTool.cs

@@ -37,6 +37,12 @@ namespace PixiEditor.Models.Tools.Tools
 
         public override void OnMouseUp(MouseEventArgs e)
         {
+            if (ViewModelMain.Current.ActiveSelection.SelectedPoints.Count() <= 1)
+            {
+                // If we have not selected multiple points, clear the selection
+                ViewModelMain.Current.ActiveSelection.Clear();
+            }
+
             UndoManager.AddUndoChange(new Change("ActiveSelection", _oldSelection,
                 ViewModelMain.Current.ActiveSelection, "Select pixels"));
         }

+ 1 - 0
PixiEditor/ViewModels/ViewModelMain.cs

@@ -279,6 +279,7 @@ namespace PixiEditor.ViewModels
                     new Shortcut(Key.Delete, DeletePixelsCommand),
                     new Shortcut(Key.I, OpenResizePopupCommand, modifier: ModifierKeys.Control | ModifierKeys.Shift),
                     new Shortcut(Key.C, OpenResizePopupCommand, "canvas", ModifierKeys.Control | ModifierKeys.Shift),
+                    new Shortcut(Key.F11, SystemCommands.MaximizeWindowCommand),
                     //File
                     new Shortcut(Key.O, OpenFileCommand, modifier: ModifierKeys.Control),
                     new Shortcut(Key.S, ExportFileCommand,

+ 2 - 0
PixiEditor/Views/MainWindow.xaml

@@ -82,6 +82,8 @@
                     <MenuItem Header="_Save As..." InputGestureText="Ctrl+Shift+S"
                               Command="{Binding SaveDocumentCommand}" CommandParameter="AsNew" />
                     <MenuItem Header="_Export" InputGestureText="Ctrl+Shift+Alt+S" Command="{Binding ExportFileCommand}" />
+                    <Separator />
+                    <MenuItem Header="_Exit" Command="{x:Static SystemCommands.CloseWindowCommand}" />
                 </MenuItem>
                 <MenuItem Header="_Edit">
                     <MenuItem Header="_Undo" InputGestureText="Ctrl+Z" Command="{Binding UndoCommand}" />