- added a toggle Grid button to the canvas context menu in the Grids submenu
This commit is contained in:
@@ -5193,6 +5193,14 @@ class App(QtCore.QObject):
|
|||||||
self.ui.cmenu_gridmenu.clear()
|
self.ui.cmenu_gridmenu.clear()
|
||||||
sorted_list = sorted(self.defaults["global_grid_context_menu"][str(units)])
|
sorted_list = sorted(self.defaults["global_grid_context_menu"][str(units)])
|
||||||
|
|
||||||
|
grid_toggle = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon('share/grid32_menu.png'), _("Grid On/Off"))
|
||||||
|
grid_toggle.setCheckable(True)
|
||||||
|
if self.grid_status():
|
||||||
|
grid_toggle.setChecked(True)
|
||||||
|
else:
|
||||||
|
grid_toggle.setChecked(False)
|
||||||
|
|
||||||
|
self.ui.cmenu_gridmenu.addSeparator()
|
||||||
for grid in sorted_list:
|
for grid in sorted_list:
|
||||||
action = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon('share/grid32_menu.png'), "%s" % str(grid))
|
action = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon('share/grid32_menu.png'), "%s" % str(grid))
|
||||||
action.triggered.connect(self.set_grid)
|
action.triggered.connect(self.set_grid)
|
||||||
@@ -5202,6 +5210,7 @@ class App(QtCore.QObject):
|
|||||||
grid_delete = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon('share/delete32.png'), _("Delete"))
|
grid_delete = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon('share/delete32.png'), _("Delete"))
|
||||||
grid_add.triggered.connect(self.on_grid_add)
|
grid_add.triggered.connect(self.on_grid_add)
|
||||||
grid_delete.triggered.connect(self.on_grid_delete)
|
grid_delete.triggered.connect(self.on_grid_delete)
|
||||||
|
grid_toggle.triggered.connect(lambda: self.ui.grid_snap_btn.trigger())
|
||||||
|
|
||||||
def set_grid(self):
|
def set_grid(self):
|
||||||
self.ui.grid_gap_x_entry.setText(self.sender().text())
|
self.ui.grid_gap_x_entry.setText(self.sender().text())
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
# MIT Licence #
|
# MIT Licence #
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
|
|
||||||
class LoudDict(dict):
|
class LoudDict(dict):
|
||||||
"""
|
"""
|
||||||
A Dictionary with a callback for
|
A Dictionary with a callback for
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
24.05.2019
|
||||||
|
|
||||||
|
- added a toggle Grid button to the canvas context menu in the Grids submenu
|
||||||
|
|
||||||
23.05.2019
|
23.05.2019
|
||||||
|
|
||||||
- fixed bug in Gerber editor FCDisk and FCSemiDisc that the resulting geometry was not stored into the '0' aperture where all the solids are stored
|
- fixed bug in Gerber editor FCDisk and FCSemiDisc that the resulting geometry was not stored into the '0' aperture where all the solids are stored
|
||||||
|
|||||||
@@ -3373,10 +3373,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
|||||||
|
|
||||||
def toolbar_tool_toggle(self, key):
|
def toolbar_tool_toggle(self, key):
|
||||||
self.options[key] = self.sender().isChecked()
|
self.options[key] = self.sender().isChecked()
|
||||||
if self.options[key] == True:
|
return 1 if self.options[key] == True else 0
|
||||||
return 1
|
|
||||||
else:
|
|
||||||
return 0
|
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
self.active_tool = None
|
self.active_tool = None
|
||||||
|
|||||||
@@ -516,9 +516,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
self.exc_editor_menu.menuAction().setVisible(False)
|
self.exc_editor_menu.menuAction().setVisible(False)
|
||||||
self.exc_editor_menu.setDisabled(True)
|
self.exc_editor_menu.setDisabled(True)
|
||||||
|
|
||||||
################################
|
# ###############################
|
||||||
### Project Tab Context menu ###
|
# ## Project Tab Context menu ###
|
||||||
################################
|
# ###############################
|
||||||
|
|
||||||
self.menuproject = QtWidgets.QMenu()
|
self.menuproject = QtWidgets.QMenu()
|
||||||
self.menuprojectenable = self.menuproject.addAction(QtGui.QIcon('share/replot32.png'), _('Enable Plot'))
|
self.menuprojectenable = self.menuproject.addAction(QtGui.QIcon('share/replot32.png'), _('Enable Plot'))
|
||||||
@@ -535,9 +535,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
self.menuprojectproperties = self.menuproject.addAction(QtGui.QIcon('share/properties32.png'), _('Properties'))
|
self.menuprojectproperties = self.menuproject.addAction(QtGui.QIcon('share/properties32.png'), _('Properties'))
|
||||||
|
|
||||||
################
|
# ###############
|
||||||
### Splitter ###
|
# ## Splitter ###
|
||||||
################
|
# ###############
|
||||||
|
|
||||||
# IMPORTANT #
|
# IMPORTANT #
|
||||||
# The order: SPITTER -> NOTEBOOK -> SNAP TOOLBAR is important and without it the GUI will not be initialized as
|
# The order: SPITTER -> NOTEBOOK -> SNAP TOOLBAR is important and without it the GUI will not be initialized as
|
||||||
@@ -1574,9 +1574,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
self.sh_hlay.addWidget(self.sh_editor)
|
self.sh_hlay.addWidget(self.sh_editor)
|
||||||
|
|
||||||
|
|
||||||
##############################################################
|
# #############################################################
|
||||||
### HERE WE BUILD THE CONTEXT MENU FOR RMB CLICK ON CANVAS ###
|
# ## HERE WE BUILD THE CONTEXT MENU FOR RMB CLICK ON CANVAS ###
|
||||||
##############################################################
|
# #############################################################
|
||||||
self.popMenu = FCMenu()
|
self.popMenu = FCMenu()
|
||||||
|
|
||||||
self.popmenu_disable = self.popMenu.addAction(QtGui.QIcon('share/clear_plot32.png'), _("Disable"))
|
self.popmenu_disable = self.popMenu.addAction(QtGui.QIcon('share/clear_plot32.png'), _("Disable"))
|
||||||
|
|||||||
Reference in New Issue
Block a user