- made the coordinates / delta coordinates / grid toolbar / actions toolbar visibility an option, controlled from the infobar (Status bar) context menu. How it's at app shutdown it's restored at the next application start

This commit is contained in:
Marius Stanciu 2020-06-13 19:50:55 +03:00 committed by Marius
parent 69d0b3ad3f
commit c44f395625
15 changed files with 221 additions and 128 deletions

View File

@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta
- modified the Tools Database such that there is now a way to mark a tool as meant to be used in a certain part of the application; it will disable or enable parts of the parameters of the tool
- updated the FCTable GUI element to work correctly when doing drag&drop for the rows
- updated the Geometry UI to work with the new FCTable
- made the coordinates / delta coordinates / grid toolbar / actions toolbar visibility an option, controlled from the infobar (Status bar) context menu. How it's at app shutdown it's restored at the next application start
12.06.2020

View File

@ -506,8 +506,8 @@ class ExclusionAreas(QtCore.QObject):
self.app.dy = curr_pos[1] - float(self.cursor_pos[1])
self.app.ui.position_label.setText("&nbsp;<b>X</b>: %.4f&nbsp;&nbsp; "
"<b>Y</b>: %.4f&nbsp;" % (curr_pos[0], curr_pos[1]))
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
units = self.app.defaults["units"].lower()
self.app.plotcanvas.text_hud.text = \

View File

@ -2830,7 +2830,7 @@ class AppExcEditor(QtCore.QObject):
self.app.ui.exc_edit_toolbar.setDisabled(False)
self.app.ui.exc_edit_toolbar.setVisible(True)
# self.app.ui.status_toolbar.setDisabled(False)
# self.app.ui.grid_toolbar.setDisabled(False)
# start with GRID toolbar activated
if self.app.ui.grid_snap_btn.isChecked() is False:
@ -3440,8 +3440,8 @@ class AppExcEditor(QtCore.QObject):
self.pos = (self.pos[0], self.pos[1])
if event.button == 1:
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (0, 0))
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (0, 0))
# Selection with left mouse button
if self.active_tool is not None and event.button == 1:
@ -3787,8 +3787,8 @@ class AppExcEditor(QtCore.QObject):
self.app.ui.position_label.setText("&nbsp;<b>X</b>: %.4f&nbsp;&nbsp; "
"<b>Y</b>: %.4f&nbsp;" % (x, y))
# # update the reference position label in the infobar since the APP mouse event handlers are disconnected
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
units = self.app.defaults["units"].lower()
self.app.plotcanvas.text_hud.text = \

View File

@ -4105,8 +4105,8 @@ class AppGeoEditor(QtCore.QObject):
self.pos = (self.pos[0], self.pos[1])
if event.button == 1:
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (0, 0))
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (0, 0))
modifiers = QtWidgets.QApplication.keyboardModifiers()
# If the SHIFT key is pressed when LMB is clicked then the coordinates are copied to clipboard
@ -4203,8 +4203,8 @@ class AppGeoEditor(QtCore.QObject):
"<b>Y</b>: %.4f&nbsp;" % (x, y))
#
# # update the reference position label in the infobar since the APP mouse event handlers are disconnected
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
units = self.app.defaults["units"].lower()
self.app.plotcanvas.text_hud.text = \

View File

@ -3703,7 +3703,7 @@ class AppGerberEditor(QtCore.QObject):
self.app.ui.grb_edit_toolbar.setDisabled(False)
self.app.ui.grb_edit_toolbar.setVisible(True)
# self.app.ui.status_toolbar.setDisabled(False)
# self.app.ui.grid_toolbar.setDisabled(False)
# start with GRID toolbar activated
if self.app.ui.grid_snap_btn.isChecked() is False:
@ -4522,8 +4522,8 @@ class AppGerberEditor(QtCore.QObject):
self.pos = (self.pos[0], self.pos[1])
if event.button == 1:
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (0, 0))
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (0, 0))
# Selection with left mouse button
if self.active_tool is not None:
@ -4770,10 +4770,10 @@ class AppGerberEditor(QtCore.QObject):
# # update the position label in the infobar since the APP mouse event handlers are disconnected
self.app.ui.position_label.setText("&nbsp;<b>X</b>: %.4f&nbsp;&nbsp; "
"<b>Y</b>: %.4f&nbsp;" % (x, y))
#
# # update the reference position label in the infobar since the APP mouse event handlers are disconnected
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
# update the reference position label in the infobar since the APP mouse event handlers are disconnected
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
units = self.app.defaults["units"].lower()
self.app.plotcanvas.text_hud.text = \

View File

@ -814,9 +814,23 @@ class MainGUI(QtWidgets.QMainWindow):
self.grb_edit_toolbar.setObjectName('GrbEditor_TB')
self.addToolBar(self.grb_edit_toolbar)
self.status_toolbar = QtWidgets.QToolBar(_('Grid Toolbar'))
self.status_toolbar.setObjectName('Snap_TB')
# self.addToolBar(self.status_toolbar)
# ### INFOBAR TOOLBARS ###################################################
self.delta_coords_toolbar = QtWidgets.QToolBar(_('Delta Coordinates Toolbar'))
self.delta_coords_toolbar.setObjectName('Delta_Coords_TB')
self.coords_toolbar = QtWidgets.QToolBar(_('Coordinates Toolbar'))
self.coords_toolbar.setObjectName('Coords_TB')
self.grid_toolbar = QtWidgets.QToolBar(_('Grid Toolbar'))
self.grid_toolbar.setObjectName('Snap_TB')
self.grid_toolbar.setStyleSheet(
"""
QToolBar { padding: 0; }
QToolBar QToolButton { padding: -2; margin: -2; }
"""
)
self.status_toolbar = QtWidgets.QToolBar(_('Status Toolbar'))
self.status_toolbar.setStyleSheet(
"""
QToolBar { padding: 0; }
@ -1073,30 +1087,46 @@ class MainGUI(QtWidgets.QMainWindow):
QtGui.QIcon(self.app.resource_location + '/move32.png'), _("Move"))
# ########################################################################
# ########################## Snap Toolbar# ###############################
# ########################## GRID Toolbar# ###############################
# ########################################################################
# Snap GRID toolbar is always active to facilitate usage of measurements done on GRID
self.grid_snap_btn = self.status_toolbar.addAction(
self.grid_snap_btn = self.grid_toolbar.addAction(
QtGui.QIcon(self.app.resource_location + '/grid32.png'), _('Snap to grid'))
self.grid_gap_x_entry = FCEntry2()
self.grid_gap_x_entry.setMaximumWidth(70)
self.grid_gap_x_entry.setToolTip(_("Grid X snapping distance"))
self.status_toolbar.addWidget(self.grid_gap_x_entry)
self.grid_toolbar.addWidget(self.grid_gap_x_entry)
self.status_toolbar.addWidget(QtWidgets.QLabel(" "))
self.grid_toolbar.addWidget(QtWidgets.QLabel(" "))
self.grid_gap_link_cb = FCCheckBox()
self.grid_gap_link_cb.setToolTip(_("When active, value on Grid_X\n"
"is copied to the Grid_Y value."))
self.status_toolbar.addWidget(self.grid_gap_link_cb)
self.status_toolbar.addWidget(QtWidgets.QLabel(" "))
self.grid_toolbar.addWidget(self.grid_gap_link_cb)
self.grid_toolbar.addWidget(QtWidgets.QLabel(" "))
self.grid_gap_y_entry = FCEntry2()
self.grid_gap_y_entry.setMaximumWidth(70)
self.grid_gap_y_entry.setToolTip(_("Grid Y snapping distance"))
self.status_toolbar.addWidget(self.grid_gap_y_entry)
self.status_toolbar.addWidget(QtWidgets.QLabel(" "))
self.grid_toolbar.addWidget(self.grid_gap_y_entry)
self.grid_toolbar.addWidget(QtWidgets.QLabel(" "))
self.ois_grid = OptionalInputSection(self.grid_gap_link_cb, [self.grid_gap_y_entry], logic=False)
self.corner_snap_btn = self.grid_toolbar.addAction(
QtGui.QIcon(self.app.resource_location + '/corner32.png'), _('Snap to corner'))
self.snap_max_dist_entry = FCEntry()
self.snap_max_dist_entry.setMaximumWidth(70)
self.snap_max_dist_entry.setToolTip(_("Max. magnet distance"))
self.snap_magnet = self.grid_toolbar.addWidget(self.snap_max_dist_entry)
self.corner_snap_btn.setVisible(False)
self.snap_magnet.setVisible(False)
# ########################################################################
# ########################## Status Toolbar ##############################
# ########################################################################
self.axis_status_label = FCLabel()
self.axis_status_label.setToolTip(_("Toggle the display of axis on canvas"))
self.axis_status_label.setPixmap(QtGui.QPixmap(self.app.resource_location + '/axis16.png'))
@ -1129,18 +1159,23 @@ class MainGUI(QtWidgets.QMainWindow):
self.status_toolbar.addWidget(self.wplace_label)
self.status_toolbar.addWidget(QtWidgets.QLabel(" "))
self.ois_grid = OptionalInputSection(self.grid_gap_link_cb, [self.grid_gap_y_entry], logic=False)
# #######################################################################
# ####################### Delta Coordinates TOOLBAR #####################
# #######################################################################
self.rel_position_label = QtWidgets.QLabel(
"<b>Dx</b>: 0.0000&nbsp;&nbsp; <b>Dy</b>: 0.0000&nbsp;&nbsp;&nbsp;&nbsp;")
self.rel_position_label.setMinimumWidth(110)
self.rel_position_label.setToolTip(_("Relative measurement.\nReference is last click position"))
self.delta_coords_toolbar.addWidget(self.rel_position_label)
self.corner_snap_btn = self.status_toolbar.addAction(
QtGui.QIcon(self.app.resource_location + '/corner32.png'), _('Snap to corner'))
self.snap_max_dist_entry = FCEntry()
self.snap_max_dist_entry.setMaximumWidth(70)
self.snap_max_dist_entry.setToolTip(_("Max. magnet distance"))
self.snap_magnet = self.status_toolbar.addWidget(self.snap_max_dist_entry)
self.corner_snap_btn.setVisible(False)
self.snap_magnet.setVisible(False)
# #######################################################################
# ####################### Coordinates TOOLBAR ###########################
# #######################################################################
self.position_label = QtWidgets.QLabel("&nbsp;<b>X</b>: 0.0000&nbsp;&nbsp; <b>Y</b>: 0.0000&nbsp;")
self.position_label.setMinimumWidth(110)
self.position_label.setToolTip(_("Absolute measurement.\n"
"Reference is (X=0, Y= 0) position"))
self.coords_toolbar.addWidget(self.position_label)
# #######################################################################
# ####################### TCL Shell DOCK ################################
@ -1544,20 +1579,19 @@ class MainGUI(QtWidgets.QMainWindow):
self.fcinfo = FlatCAMInfoBar(app=self.app)
self.infobar.addWidget(self.fcinfo, stretch=1)
# self.rel_position_label = QtWidgets.QLabel(
# "<b>Dx</b>: 0.0000&nbsp;&nbsp; <b>Dy</b>: 0.0000&nbsp;&nbsp;&nbsp;&nbsp;")
# self.rel_position_label.setMinimumWidth(110)
# self.rel_position_label.setToolTip(_("Relative measurement.\nReference is last click position"))
# self.infobar.addWidget(self.rel_position_label)
#
self.position_label = QtWidgets.QLabel("&nbsp;<b>X</b>: 0.0000&nbsp;&nbsp; <b>Y</b>: 0.0000&nbsp;")
self.position_label.setMinimumWidth(110)
self.position_label.setToolTip(_("Absolute measurement.\n"
"Reference is (X=0, Y= 0) position"))
self.infobar.addWidget(self.position_label)
self.infobar.addWidget(self.delta_coords_toolbar)
self.delta_coords_toolbar.setVisible(self.app.defaults["global_delta_coords_show"])
self.infobar.addWidget(self.coords_toolbar)
self.coords_toolbar.setVisible(self.app.defaults["global_coords_show"])
self.grid_toolbar.setMaximumHeight(24)
self.infobar.addWidget(self.grid_toolbar)
self.grid_toolbar.setVisible(self.app.defaults["global_grid_show"])
self.status_toolbar.setMaximumHeight(24)
self.infobar.addWidget(self.status_toolbar)
self.status_toolbar.setVisible(self.app.defaults["global_status_show"])
self.units_label = QtWidgets.QLabel("[mm]")
self.units_label.setToolTip(_("Application units"))
@ -1707,6 +1741,18 @@ class MainGUI(QtWidgets.QMainWindow):
self.shell_dock.visibilityChanged.connect(self.on_shelldock_toggled)
# Notebook and Plot Tab Area signals
# make the right click on the notebook tab and plot tab area tab raise a menu
self.notebook.tabBar.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.plot_tab_area.tabBar.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.on_tab_setup_context_menu()
# activate initial state
self.on_detachable_tab_rmb_click(self.app.defaults["global_tabs_detachable"])
# status bar activation/deactivation
self.infobar.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.build_infobar_context_menu()
def save_geometry(self, x, y, width, height, notebook_width):
"""
Will save the application geometry and positions in the defaults dicitionary to be restored at the next
@ -1782,18 +1828,90 @@ class MainGUI(QtWidgets.QMainWindow):
self.grb_edit_toolbar.setVisible(False)
# if tb & 128:
# self.ui.status_toolbar.setVisible(True)
# self.ui.grid_toolbar.setVisible(True)
# else:
# self.ui.status_toolbar.setVisible(False)
# self.ui.grid_toolbar.setVisible(False)
# Grid Toolbar is always active now
self.status_toolbar.setVisible(True)
# Grid Toolbar is controlled by its own setting
if tb & 256:
self.toolbarshell.setVisible(True)
else:
self.toolbarshell.setVisible(False)
def on_tab_setup_context_menu(self):
initial_checked = self.app.defaults["global_tabs_detachable"]
action_name = str(_("Detachable Tabs"))
action = QtWidgets.QAction(self)
action.setCheckable(True)
action.setText(action_name)
action.setChecked(initial_checked)
self.notebook.tabBar.addAction(action)
self.plot_tab_area.tabBar.addAction(action)
try:
action.triggered.disconnect()
except TypeError:
pass
action.triggered.connect(self.on_detachable_tab_rmb_click)
def on_detachable_tab_rmb_click(self, checked):
self.notebook.set_detachable(val=checked)
self.app.defaults["global_tabs_detachable"] = checked
self.plot_tab_area.set_detachable(val=checked)
self.app.defaults["global_tabs_detachable"] = checked
def build_infobar_context_menu(self):
delta_coords_action_name = str(_("Delta Coordinates Toolbar"))
delta_coords_action = QtWidgets.QAction(self)
delta_coords_action.setCheckable(True)
delta_coords_action.setText(delta_coords_action_name)
delta_coords_action.setChecked(self.app.defaults["global_delta_coords_show"])
self.infobar.addAction(delta_coords_action)
delta_coords_action.triggered.connect(self.toggle_delta_coords)
coords_action_name = str(_("Coordinates Toolbar"))
coords_action = QtWidgets.QAction(self)
coords_action.setCheckable(True)
coords_action.setText(coords_action_name)
coords_action.setChecked(self.app.defaults["global_coords_show"])
self.infobar.addAction(coords_action)
coords_action.triggered.connect(self.toggle_coords)
grid_action_name = str(_("Grid Toolbar"))
grid_action = QtWidgets.QAction(self)
grid_action.setCheckable(True)
grid_action.setText(grid_action_name)
grid_action.setChecked(self.app.defaults["global_grid_show"])
self.infobar.addAction(grid_action)
grid_action.triggered.connect(self.toggle_gridbar)
status_action_name = str(_("Status Toolbar"))
status_action = QtWidgets.QAction(self)
status_action.setCheckable(True)
status_action.setText(status_action_name)
status_action.setChecked(self.app.defaults["global_status_show"])
self.infobar.addAction(status_action)
status_action.triggered.connect(self.toggle_statusbar)
def toggle_coords(self, checked):
self.app.defaults["global_coords_show"] = checked
self.coords_toolbar.setVisible(checked)
def toggle_delta_coords(self, checked):
self.app.defaults["global_delta_coords_show"] = checked
self.delta_coords_toolbar.setVisible(checked)
def toggle_gridbar(self, checked):
self.app.defaults["global_grid_show"] = checked
self.grid_toolbar.setVisible(checked)
def toggle_statusbar(self, checked):
self.app.defaults["global_status_show"] = checked
self.status_toolbar.setVisible(checked)
def eventFilter(self, obj, event):
"""
Filter the ToolTips display based on a Preferences setting
@ -3613,7 +3731,8 @@ class MainGUI(QtWidgets.QMainWindow):
# hide all Toolbars
for tb in self.findChildren(QtWidgets.QToolBar):
tb.setVisible(False)
self.status_toolbar.setVisible(True) # This Toolbar is always visible so restore it
self.grid_toolbar.setVisible(self.app.defaults["global_grid_show"])
self.splitter.setSizes([0, 1])
self.toggle_fscreen = True

View File

@ -564,7 +564,7 @@ class CNCJobObject(FlatCAMObj, CNCjob):
# delete the absolute and relative position and messages in the infobar
self.app.ui.position_label.setText("")
# self.app.ui.rel_position_label.setText("")
self.app.ui.rel_position_label.setText("")
# first clear previous text in text editor (if any)
self.gcode_editor_tab.code_editor.clear()

View File

@ -1069,7 +1069,7 @@ class ToolCalibration(AppTool):
# delete the absolute and relative position and messages in the infobar
self.app.ui.position_label.setText("")
# self.app.ui.rel_position_label.setText("")
self.app.ui.rel_position_label.setText("")
# first clear previous text in text editor (if any)
self.gcode_editor_tab.code_editor.clear()

View File

@ -923,8 +923,8 @@ class ToolCopperThieving(AppTool):
# # update the positions on status bar
self.app.ui.position_label.setText("&nbsp;<b>X</b>: %.4f&nbsp;&nbsp; "
"<b>Y</b>: %.4f&nbsp;" % (curr_pos[0], curr_pos[1]))
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
units = self.app.defaults["units"].lower()
self.app.plotcanvas.text_hud.text = \

View File

@ -475,9 +475,9 @@ class Distance(AppTool):
# Reset here the relative coordinates so there is a new reference on the click position
if self.rel_point1 is None:
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.*f&nbsp;&nbsp; <b>Dy</b>: "
# "%.*f&nbsp;&nbsp;&nbsp;&nbsp;" %
# (self.decimals, 0.0, self.decimals, 0.0))
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.*f&nbsp;&nbsp; <b>Dy</b>: "
"%.*f&nbsp;&nbsp;&nbsp;&nbsp;" %
(self.decimals, 0.0, self.decimals, 0.0))
self.rel_point1 = pos
else:
self.rel_point2 = copy(self.rel_point1)
@ -520,11 +520,11 @@ class Distance(AppTool):
pass
self.total_distance_entry.set_value('%.*f' % (self.decimals, abs(d)))
# self.app.ui.rel_position_label.setText(
# "<b>Dx</b>: {}&nbsp;&nbsp; <b>Dy</b>: {}&nbsp;&nbsp;&nbsp;&nbsp;".format(
# '%.*f' % (self.decimals, pos[0]), '%.*f' % (self.decimals, pos[1])
# )
# )
self.app.ui.rel_position_label.setText(
"<b>Dx</b>: {}&nbsp;&nbsp; <b>Dy</b>: {}&nbsp;&nbsp;&nbsp;&nbsp;".format(
'%.*f' % (self.decimals, pos[0]), '%.*f' % (self.decimals, pos[1])
)
)
self.tool_done = True
self.deactivate_measure_tool()
@ -573,11 +573,11 @@ class Distance(AppTool):
dx = pos[0]
dy = pos[1]
# self.app.ui.rel_position_label.setText(
# "<b>Dx</b>: {}&nbsp;&nbsp; <b>Dy</b>: {}&nbsp;&nbsp;&nbsp;&nbsp;".format(
# '%.*f' % (self.decimals, dx), '%.*f' % (self.decimals, dy)
# )
# )
self.app.ui.rel_position_label.setText(
"<b>Dx</b>: {}&nbsp;&nbsp; <b>Dy</b>: {}&nbsp;&nbsp;&nbsp;&nbsp;".format(
'%.*f' % (self.decimals, dx), '%.*f' % (self.decimals, dy)
)
)
# update utility geometry
if len(self.points) == 1:
@ -595,7 +595,7 @@ class Distance(AppTool):
except Exception as e:
log.debug("Distance.on_mouse_move_meas() --> %s" % str(e))
self.app.ui.position_label.setText("")
# self.app.ui.rel_position_label.setText("")
self.app.ui.rel_position_label.setText("")
def utility_geometry(self, pos):
# first delete old shape

View File

@ -2693,8 +2693,8 @@ class ToolIsolation(AppTool, Gerber):
# # update the positions on status bar
self.app.ui.position_label.setText("&nbsp;<b>X</b>: %.4f&nbsp;&nbsp; "
"<b>Y</b>: %.4f&nbsp;" % (curr_pos[0], curr_pos[1]))
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
units = self.app.defaults["units"].lower()
self.app.plotcanvas.text_hud.text = \

View File

@ -1285,8 +1285,8 @@ class NonCopperClear(AppTool, Gerber):
# # update the positions on status bar
self.app.ui.position_label.setText("&nbsp;<b>X</b>: %.4f&nbsp;&nbsp; "
"<b>Y</b>: %.4f&nbsp;" % (curr_pos[0], curr_pos[1]))
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
units = self.app.defaults["units"].lower()
self.app.plotcanvas.text_hud.text = \

View File

@ -1752,8 +1752,8 @@ class ToolPaint(AppTool, Gerber):
# # update the positions on status bar
self.app.ui.position_label.setText("&nbsp;<b>X</b>: %.4f&nbsp;&nbsp; "
"<b>Y</b>: %.4f&nbsp;" % (curr_pos[0], curr_pos[1]))
# self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
units = self.app.defaults["units"].lower()
self.app.plotcanvas.text_hud.text = \

View File

@ -922,14 +922,6 @@ class App(QtCore.QObject):
# ToolBar signals
self.connect_toolbar_signals(ui=self.ui)
# Notebook and Plot Tab Area signals
# make the right click on the notebook tab and plot tab area tab raise a menu
self.ui.notebook.tabBar.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.ui.plot_tab_area.tabBar.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.on_tab_setup_context_menu()
# activate initial state
self.on_tab_rmb_click(self.defaults["global_tabs_detachable"])
# Context Menu
self.ui.popmenu_disable.triggered.connect(lambda: self.toggle_plots(self.collection.get_selected()))
self.ui.popmenu_panel_toggle.triggered.connect(self.ui.on_toggle_notebook)
@ -3223,7 +3215,7 @@ class App(QtCore.QObject):
# delete the absolute and relative position and messages in the infobar
self.ui.position_label.setText("")
# self.ui.rel_position_label.setText("")
self.ui.rel_position_label.setText("")
# Switch plot_area to preferences page
self.ui.plot_tab_area.setCurrentWidget(self.book_dialog_tab)
@ -4281,30 +4273,6 @@ class App(QtCore.QObject):
self.ui.grid_gap_x_entry.set_value(val_x, decimals=self.decimals)
self.ui.grid_gap_y_entry.set_value(val_y, decimals=self.decimals)
def on_tab_rmb_click(self, checked):
self.ui.notebook.set_detachable(val=checked)
self.defaults["global_tabs_detachable"] = checked
self.ui.plot_tab_area.set_detachable(val=checked)
self.defaults["global_tabs_detachable"] = checked
def on_tab_setup_context_menu(self):
initial_checked = self.defaults["global_tabs_detachable"]
action_name = str(_("Detachable Tabs"))
action = QtWidgets.QAction(self)
action.setCheckable(True)
action.setText(action_name)
action.setChecked(initial_checked)
self.ui.notebook.tabBar.addAction(action)
self.ui.plot_tab_area.tabBar.addAction(action)
try:
action.triggered.disconnect()
except TypeError:
pass
action.triggered.connect(self.on_tab_rmb_click)
def on_deselect_all(self):
self.collection.set_all_inactive()
self.delete_selection_shape()
@ -4836,10 +4804,9 @@ class App(QtCore.QObject):
dy = location[1] - float(self.rel_point1[1])
self.ui.position_label.setText("&nbsp;<b>X</b>: %.4f&nbsp;&nbsp; "
"<b>Y</b>: %.4f&nbsp;" % (location[0], location[1]))
# # Set the position label
#
# self.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (dx, dy))
# Set the position label
self.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (dx, dy))
units = self.defaults["units"].lower()
self.plotcanvas.text_hud.text = \
@ -4992,8 +4959,8 @@ class App(QtCore.QObject):
# Set the position label
self.ui.position_label.setText("&nbsp;<b>X</b>: %.4f&nbsp;&nbsp; "
"<b>Y</b>: %.4f&nbsp;" % (location[0], location[1]))
# self.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.dx, self.dy))
self.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.dx, self.dy))
units = self.defaults["units"].lower()
self.plotcanvas.text_hud.text = \
@ -5333,7 +5300,7 @@ class App(QtCore.QObject):
# delete the absolute and relative position and messages in the infobar
self.ui.position_label.setText("")
# self.ui.rel_position_label.setText("")
self.ui.rel_position_label.setText("")
# Switch plot_area to preferences page
self.ui.plot_tab_area.setCurrentWidget(self.ui.preferences_tab)
@ -5445,7 +5412,7 @@ class App(QtCore.QObject):
# delete the absolute and relative position and messages in the infobar
self.ui.position_label.setText("")
# self.ui.rel_position_label.setText("")
self.ui.rel_position_label.setText("")
# Switch plot_area to preferences page
self.ui.plot_tab_area.setCurrentWidget(self.tools_db_tab)
@ -5911,7 +5878,7 @@ class App(QtCore.QObject):
# delete the absolute and relative position and messages in the infobar
self.ui.position_label.setText("")
# self.ui.rel_position_label.setText("")
self.ui.rel_position_label.setText("")
# Switch plot_area to preferences page
self.ui.plot_tab_area.setCurrentWidget(self.ui.shortcuts_tab)
@ -6061,8 +6028,8 @@ class App(QtCore.QObject):
self.ui.position_label.setText("&nbsp;<b>X</b>: %.4f&nbsp;&nbsp; "
"<b>Y</b>: %.4f&nbsp;" % (pos[0], pos[1]))
# self.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.dx, self.dy))
self.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.dx, self.dy))
units = self.defaults["units"].lower()
self.plotcanvas.text_hud.text = \
@ -6120,7 +6087,7 @@ class App(QtCore.QObject):
except Exception as e:
log.debug("App.on_mouse_move_over_plot() - rel_point1 is not None -> %s" % str(e))
self.ui.position_label.setText("")
# self.ui.rel_position_label.setText("")
self.ui.rel_position_label.setText("")
self.mouse = None
def on_mouse_click_release_over_plot(self, event):
@ -7450,7 +7417,7 @@ class App(QtCore.QObject):
# delete the absolute and relative position and messages in the infobar
self.ui.position_label.setText("")
# self.ui.rel_position_label.setText("")
self.ui.rel_position_label.setText("")
# first clear previous text in text editor (if any)
self.text_editor_tab.code_editor.clear()
@ -7501,7 +7468,7 @@ class App(QtCore.QObject):
# delete the absolute and relative position and messages in the infobar
self.ui.position_label.setText("")
# self.ui.rel_position_label.setText("")
self.ui.rel_position_label.setText("")
# first clear previous text in text editor (if any)
self.source_editor_tab.code_editor.clear()
@ -7623,7 +7590,7 @@ class App(QtCore.QObject):
# delete the absolute and relative position and messages in the infobar
self.ui.position_label.setText("")
# self.ui.rel_position_label.setText("")
self.ui.rel_position_label.setText("")
self.app_obj.new_script_object()

View File

@ -29,6 +29,12 @@ class FlatCAMDefaults:
"global_serial": 0,
"global_stats": dict(),
"global_tabs_detachable": True,
"global_coords_show": True,
"global_delta_coords_show": False,
"global_grid_show": True,
"global_status_show": True,
"global_jump_ref": 'abs',
"global_locate_pt": 'bl',