Added deselect on esc shortcut when selection tool active#2205
Added deselect on esc shortcut when selection tool active#2205Sam-Gledhill wants to merge 1 commit into
Conversation
|
Hi there. The Ubuntu test failed with dozens of formatting errors, but when I ran |
cameronwhite
left a comment
There was a problem hiding this comment.
Sometimes the CI builds have a newer version of dotnet format which has different behaviours from the local version - don't worry about it and I can fix it up before merging
| shortcuts: ["<Primary><Shift>A", "<Ctrl>D"]); | ||
|
|
||
| DeselectSelection = new Command ( | ||
| "deselect", |
There was a problem hiding this comment.
Giving this command the same identifier as the other deselect command will probably cause some issues - e.g. on macOS this seems to cause the menu item to not show its shortcut.
However, I think it'd be worth trying to just merge this with the other command and just add Escape as an alternative shortcut which works while in any tool (matching Paint.NET behaviour). The only thing to test would be to verify that the text tool can still handle Escape to finish editing the text while a selection is active, then pressing Escape again would clear the selection
| private void HandlePintaCoreActionsEditDeselectSelectionActivated (object sender, EventArgs e) | ||
| { | ||
|
|
||
| if (!selection_tools.Contains (tools.CurrentTool?.ToString ())) { |
There was a problem hiding this comment.
There is an IsSelectionTool property that can be checked on the current tool instead of hardcoding names, but we may not need to check this anyways (see other comment)
Calls existing deselect function on escape key press, but only when a selection tool is active (EllipseSelect, RectangleSelect, LassoSelect).
Addresses #1849.