diff --git a/CHANGELOG.md b/CHANGELOG.md index f24a0f23..8c24fe61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ CHANGELOG for FlatCAM beta - updated the translation strings - fixed the UI layout in Excellon Editor and made sure that after changing a value in the Notebook side after the mouse is inside the canvas, the canvas takes the focus allowing the key shortcuts to work - Turkish language strings updated (by Mehmet Kaya) +- in Gerber Editor added the shortcut key 'Space' to change the direction of the array of pads 3.11.2020 diff --git a/appEditors/AppGerberEditor.py b/appEditors/AppGerberEditor.py index 660da32a..a86fb376 100644 --- a/appEditors/AppGerberEditor.py +++ b/appEditors/AppGerberEditor.py @@ -744,6 +744,31 @@ class FCPadArray(FCShapeTool): self.draw_app.ui.array_frame.hide() self.draw_app.app.jump_signal.disconnect() + def on_key(self, key): + key_modifier = QtWidgets.QApplication.keyboardModifiers() + + if key_modifier == QtCore.Qt.ShiftModifier: + mod_key = 'Shift' + elif key_modifier == QtCore.Qt.ControlModifier: + mod_key = 'Control' + else: + mod_key = None + + if mod_key == 'Control': + pass + elif mod_key is None: + # Toggle Drill Array Direction + if key == QtCore.Qt.Key_Space: + if self.draw_app.ui.pad_axis_radio.get_value() == 'X': + self.draw_app.ui.pad_axis_radio.set_value('Y') + elif self.draw_app.ui.pad_axis_radio.get_value() == 'Y': + self.draw_app.ui.pad_axis_radio.set_value('A') + elif self.draw_app.ui.pad_axis_radio.get_value() == 'A': + self.draw_app.ui.pad_axis_radio.set_value('X') + + # ## Utility geometry (animated) + self.draw_app.update_utility_geometry(data=(self.draw_app.snap_x, self.draw_app.snap_y)) + def clean_up(self): self.draw_app.selected = [] self.draw_app.ui.apertures_table.clearSelection() diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index 89c1985f..5d6da3a0 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -3277,10 +3277,6 @@ class MainGUI(QtWidgets.QMainWindow): self.on_toggle_notebook() return - # Rotate - if key == QtCore.Qt.Key_Space or key == 'Space': - self.app.grb_editor.transform_tool.on_rotate_key() - # Switch to Project Tab if key == QtCore.Qt.Key_1 or key == '1': self.app.grb_editor.launched_from_shortcuts = True @@ -3306,6 +3302,11 @@ class MainGUI(QtWidgets.QMainWindow): if response is not None: self.app.inform.emit(response) else: + + # Rotate + if key == QtCore.Qt.Key_Space or key == 'Space': + self.app.grb_editor.transform_tool.on_rotate_key() + # Add Array of pads if key == QtCore.Qt.Key_A or key == 'A': self.app.grb_editor.launched_from_shortcuts = True @@ -4823,7 +4824,7 @@ class ShortcutsTab(QtWidgets.QWidget): _('Esc'), _("Abort and return to Select"), _('Space'), _("Toggle Slot direction"), _('Ctrl+S'), _("Save Object and Exit Editor"), - _('Ctrl+Space'), _("Toggle Slot Array direction") + _('Ctrl+Space'), _("Toggle array direction") ) # GERBER EDITOR SHORTCUT LIST @@ -4900,6 +4901,11 @@ class ShortcutsTab(QtWidgets.QWidget): %s  %s + + + %s +  %s +     @@ -4957,6 +4963,7 @@ class ShortcutsTab(QtWidgets.QWidget): _('Del'), _("Delete"), _('Del'), _("Alternate: Delete Apertures"), _('Esc'), _("Abort and return to Select"), + _('Space'), _("Toggle array direction"), _('Shift+M'), _("Distance Minimum Tool"), _('Ctrl+E'), _("Eraser Tool"), _('Ctrl+S'), _("Save Object and Exit Editor"),