- repurposed shortcut key 'Delete' to delete tools in tooltable when the mouse is over the Seleted tab (with Geometry inside) or in Tools tab (when NCC Tool or Paint Tool is inside). Or in Excellon Editor when mouse is hovering the Selected tab selecting a tool, 'Delete' key will delete that tool, if on canvas 'Delete' key will delete a selected shape (drill). In rest, will delete selected objects.

This commit is contained in:
Marius Stanciu
2019-02-10 02:09:05 +02:00
committed by Marius S
parent b68a010bde
commit f35994a712
4 changed files with 128 additions and 69 deletions

View File

@@ -2688,6 +2688,10 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
temp_tools = copy.deepcopy(self.tools)
for tooluid_key in self.tools:
if int(tooluid_key) == tooluid_del:
# if the self.tools has only one tool and we delete it then we move the solid_geometry
# as a property of the object otherwise there will be nothing to hold it
if len(self.tools) == 1:
self.solid_geometry = copy.deepcopy(self.tools[tooluid_key]['solid_geometry'])
temp_tools.pop(tooluid_del, None)
self.tools = copy.deepcopy(temp_tools)
temp_tools.clear()