- Geometry Editor: restored the old behavior: a tool is active until it is voluntarily exited: either by using the 'ESC' key, or selecting the Select tool or new: right click on canvas
- RELEASE 8.915
This commit is contained in:
parent
53620007db
commit
a98e6c3eda
|
@ -23,6 +23,8 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
- Excellon Editor: fixed mouse right click was always doing popup context menu
|
- Excellon Editor: fixed mouse right click was always doing popup context menu
|
||||||
- GUIElements.FCEntry2(): added a try-except clause
|
- GUIElements.FCEntry2(): added a try-except clause
|
||||||
- made sure that the Tools Tab is cleared on Editors exit
|
- made sure that the Tools Tab is cleared on Editors exit
|
||||||
|
- Geometry Editor: restored the old behavior: a tool is active until it is voluntarily exited: either by using the 'ESC' key, or selecting the Select tool or new: right click on canvas
|
||||||
|
- RELEASE 8.915
|
||||||
|
|
||||||
30.04.2019
|
30.04.2019
|
||||||
|
|
||||||
|
|
|
@ -3342,7 +3342,6 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||||
# Selection with left mouse button
|
# Selection with left mouse button
|
||||||
if self.active_tool is not None and event.button is 1:
|
if self.active_tool is not None and event.button is 1:
|
||||||
# Dispatch event to active_tool
|
# Dispatch event to active_tool
|
||||||
# msg = self.active_tool.click(self.snap(event.xdata, event.ydata))
|
|
||||||
msg = self.active_tool.click(self.snap(self.pos[0], self.pos[1]))
|
msg = self.active_tool.click(self.snap(self.pos[0], self.pos[1]))
|
||||||
|
|
||||||
# If it is a shape generating tool
|
# If it is a shape generating tool
|
||||||
|
@ -3357,13 +3356,19 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||||
else:
|
else:
|
||||||
modifier_to_use = Qt.ShiftModifier
|
modifier_to_use = Qt.ShiftModifier
|
||||||
|
|
||||||
|
if isinstance(self.active_tool, FCText):
|
||||||
|
self.select_tool("select")
|
||||||
|
else:
|
||||||
|
self.select_tool(self.active_tool.name)
|
||||||
|
|
||||||
|
|
||||||
# if modifier key is pressed then we add to the selected list the current shape but if
|
# if modifier key is pressed then we add to the selected list the current shape but if
|
||||||
# it's already in the selected list, we removed it. Therefore first click selects, second deselects.
|
# it's already in the selected list, we removed it. Therefore first click selects, second deselects.
|
||||||
if key_modifier == modifier_to_use:
|
# if key_modifier == modifier_to_use:
|
||||||
self.select_tool(self.active_tool.name)
|
# self.select_tool(self.active_tool.name)
|
||||||
else:
|
# else:
|
||||||
self.select_tool("select")
|
# self.select_tool("select")
|
||||||
return
|
# return
|
||||||
|
|
||||||
if isinstance(self.active_tool, FCSelect):
|
if isinstance(self.active_tool, FCSelect):
|
||||||
# self.app.log.debug("Replotting after click.")
|
# self.app.log.debug("Replotting after click.")
|
||||||
|
@ -3471,9 +3476,16 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.app.cursor = QtGui.QCursor()
|
if self.active_tool.complete is False and not isinstance(self.active_tool, FCSelect):
|
||||||
self.app.populate_cmenu_grids()
|
self.active_tool.complete = True
|
||||||
self.app.ui.popMenu.popup(self.app.cursor.pos())
|
self.in_action = False
|
||||||
|
self.delete_utility_geometry()
|
||||||
|
self.app.inform.emit(_("[success] Done."))
|
||||||
|
self.select_tool('select')
|
||||||
|
else:
|
||||||
|
self.app.cursor = QtGui.QCursor()
|
||||||
|
self.app.populate_cmenu_grids()
|
||||||
|
self.app.ui.popMenu.popup(self.app.cursor.pos())
|
||||||
else:
|
else:
|
||||||
# if right click on canvas and the active tool need to be finished (like Path or Polygon)
|
# if right click on canvas and the active tool need to be finished (like Path or Polygon)
|
||||||
# right mouse click will finish the action
|
# right mouse click will finish the action
|
||||||
|
@ -3483,19 +3495,20 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||||
if self.active_tool.complete:
|
if self.active_tool.complete:
|
||||||
self.on_shape_complete()
|
self.on_shape_complete()
|
||||||
self.app.inform.emit(_("[success] Done."))
|
self.app.inform.emit(_("[success] Done."))
|
||||||
|
self.select_tool(self.active_tool.name)
|
||||||
|
|
||||||
# MS: always return to the Select Tool if modifier key is not pressed
|
# MS: always return to the Select Tool if modifier key is not pressed
|
||||||
# else return to the current tool
|
# else return to the current tool
|
||||||
key_modifier = QtWidgets.QApplication.keyboardModifiers()
|
# key_modifier = QtWidgets.QApplication.keyboardModifiers()
|
||||||
if self.app.defaults["global_mselect_key"] == 'Control':
|
# if self.app.defaults["global_mselect_key"] == 'Control':
|
||||||
modifier_to_use = Qt.ControlModifier
|
# modifier_to_use = Qt.ControlModifier
|
||||||
else:
|
# else:
|
||||||
modifier_to_use = Qt.ShiftModifier
|
# modifier_to_use = Qt.ShiftModifier
|
||||||
|
#
|
||||||
if key_modifier == modifier_to_use:
|
# if key_modifier == modifier_to_use:
|
||||||
self.select_tool(self.active_tool.name)
|
# self.select_tool(self.active_tool.name)
|
||||||
else:
|
# else:
|
||||||
self.select_tool("select")
|
# self.select_tool("select")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.warning("Error: %s" % str(e))
|
log.warning("Error: %s" % str(e))
|
||||||
|
|
|
@ -3258,7 +3258,6 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||||
# Selection with left mouse button
|
# Selection with left mouse button
|
||||||
if self.active_tool is not None and event.button is 1:
|
if self.active_tool is not None and event.button is 1:
|
||||||
# Dispatch event to active_tool
|
# Dispatch event to active_tool
|
||||||
# msg = self.active_tool.click(self.app.geo_editor.snap(event.xdata, event.ydata))
|
|
||||||
msg = self.active_tool.click(self.app.geo_editor.snap(self.pos[0], self.pos[1]))
|
msg = self.active_tool.click(self.app.geo_editor.snap(self.pos[0], self.pos[1]))
|
||||||
|
|
||||||
# If it is a shape generating tool
|
# If it is a shape generating tool
|
||||||
|
|
Loading…
Reference in New Issue