diff --git a/CHANGELOG.md b/CHANGELOG.md index 9002a57f..f600a126 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Common.py b/Common.py index 7b303887..ee51773d 100644 --- a/Common.py +++ b/Common.py @@ -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(" X: %.4f   " "Y: %.4f " % (curr_pos[0], curr_pos[1])) - # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " - # "%.4f    " % (self.app.dx, self.app.dy)) + self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (self.app.dx, self.app.dy)) units = self.app.defaults["units"].lower() self.app.plotcanvas.text_hud.text = \ diff --git a/appEditors/AppExcEditor.py b/appEditors/AppExcEditor.py index e234445a..dc251c0c 100644 --- a/appEditors/AppExcEditor.py +++ b/appEditors/AppExcEditor.py @@ -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("Dx: %.4f   Dy: " - # "%.4f    " % (0, 0)) + self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (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(" X: %.4f   " "Y: %.4f " % (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("Dx: %.4f   Dy: " - # "%.4f    " % (self.app.dx, self.app.dy)) + self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (self.app.dx, self.app.dy)) units = self.app.defaults["units"].lower() self.app.plotcanvas.text_hud.text = \ diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index 73ff900a..6f7ba9e6 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -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("Dx: %.4f   Dy: " - # "%.4f    " % (0, 0)) + self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (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): "Y: %.4f " % (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("Dx: %.4f   Dy: " - # "%.4f    " % (self.app.dx, self.app.dy)) + self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (self.app.dx, self.app.dy)) units = self.app.defaults["units"].lower() self.app.plotcanvas.text_hud.text = \ diff --git a/appEditors/AppGerberEditor.py b/appEditors/AppGerberEditor.py index b6c48250..30b7bd99 100644 --- a/appEditors/AppGerberEditor.py +++ b/appEditors/AppGerberEditor.py @@ -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("Dx: %.4f   Dy: " - # "%.4f    " % (0, 0)) + self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (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(" X: %.4f   " "Y: %.4f " % (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("Dx: %.4f   Dy: " - # "%.4f    " % (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("Dx: %.4f   Dy: " + "%.4f    " % (self.app.dx, self.app.dy)) units = self.app.defaults["units"].lower() self.app.plotcanvas.text_hud.text = \ diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index 2d075671..607c58d9 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -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( + "Dx: 0.0000   Dy: 0.0000    ") + 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(" X: 0.0000   Y: 0.0000 ") + 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( - # "Dx: 0.0000   Dy: 0.0000    ") - # 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(" X: 0.0000   Y: 0.0000 ") - 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 diff --git a/appObjects/FlatCAMCNCJob.py b/appObjects/FlatCAMCNCJob.py index 86c602c1..73978b9a 100644 --- a/appObjects/FlatCAMCNCJob.py +++ b/appObjects/FlatCAMCNCJob.py @@ -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() diff --git a/appTools/ToolCalibration.py b/appTools/ToolCalibration.py index 10a00bc2..7a9d4ef0 100644 --- a/appTools/ToolCalibration.py +++ b/appTools/ToolCalibration.py @@ -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() diff --git a/appTools/ToolCopperThieving.py b/appTools/ToolCopperThieving.py index 468073bf..e082ba82 100644 --- a/appTools/ToolCopperThieving.py +++ b/appTools/ToolCopperThieving.py @@ -923,8 +923,8 @@ class ToolCopperThieving(AppTool): # # update the positions on status bar self.app.ui.position_label.setText(" X: %.4f   " "Y: %.4f " % (curr_pos[0], curr_pos[1])) - # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " - # "%.4f    " % (self.app.dx, self.app.dy)) + self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (self.app.dx, self.app.dy)) units = self.app.defaults["units"].lower() self.app.plotcanvas.text_hud.text = \ diff --git a/appTools/ToolDistance.py b/appTools/ToolDistance.py index 078aee31..ac48f9ce 100644 --- a/appTools/ToolDistance.py +++ b/appTools/ToolDistance.py @@ -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("Dx: %.*f   Dy: " - # "%.*f    " % - # (self.decimals, 0.0, self.decimals, 0.0)) + self.app.ui.rel_position_label.setText("Dx: %.*f   Dy: " + "%.*f    " % + (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( - # "Dx: {}   Dy: {}    ".format( - # '%.*f' % (self.decimals, pos[0]), '%.*f' % (self.decimals, pos[1]) - # ) - # ) + self.app.ui.rel_position_label.setText( + "Dx: {}   Dy: {}    ".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( - # "Dx: {}   Dy: {}    ".format( - # '%.*f' % (self.decimals, dx), '%.*f' % (self.decimals, dy) - # ) - # ) + self.app.ui.rel_position_label.setText( + "Dx: {}   Dy: {}    ".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 diff --git a/appTools/ToolIsolation.py b/appTools/ToolIsolation.py index 4f3c7b8e..f5e9dcb0 100644 --- a/appTools/ToolIsolation.py +++ b/appTools/ToolIsolation.py @@ -2693,8 +2693,8 @@ class ToolIsolation(AppTool, Gerber): # # update the positions on status bar self.app.ui.position_label.setText(" X: %.4f   " "Y: %.4f " % (curr_pos[0], curr_pos[1])) - # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " - # "%.4f    " % (self.app.dx, self.app.dy)) + self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (self.app.dx, self.app.dy)) units = self.app.defaults["units"].lower() self.app.plotcanvas.text_hud.text = \ diff --git a/appTools/ToolNCC.py b/appTools/ToolNCC.py index 3a89cc1a..ebd840a8 100644 --- a/appTools/ToolNCC.py +++ b/appTools/ToolNCC.py @@ -1285,8 +1285,8 @@ class NonCopperClear(AppTool, Gerber): # # update the positions on status bar self.app.ui.position_label.setText(" X: %.4f   " "Y: %.4f " % (curr_pos[0], curr_pos[1])) - # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " - # "%.4f    " % (self.app.dx, self.app.dy)) + self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (self.app.dx, self.app.dy)) units = self.app.defaults["units"].lower() self.app.plotcanvas.text_hud.text = \ diff --git a/appTools/ToolPaint.py b/appTools/ToolPaint.py index 7de88450..7ec666bc 100644 --- a/appTools/ToolPaint.py +++ b/appTools/ToolPaint.py @@ -1752,8 +1752,8 @@ class ToolPaint(AppTool, Gerber): # # update the positions on status bar self.app.ui.position_label.setText(" X: %.4f   " "Y: %.4f " % (curr_pos[0], curr_pos[1])) - # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " - # "%.4f    " % (self.app.dx, self.app.dy)) + self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (self.app.dx, self.app.dy)) units = self.app.defaults["units"].lower() self.app.plotcanvas.text_hud.text = \ diff --git a/app_Main.py b/app_Main.py index 5acb07f0..a9512c3b 100644 --- a/app_Main.py +++ b/app_Main.py @@ -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(" X: %.4f   " "Y: %.4f " % (location[0], location[1])) - # # Set the position label - # - # self.ui.rel_position_label.setText("Dx: %.4f   Dy: " - # "%.4f    " % (dx, dy)) + # Set the position label + self.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (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(" X: %.4f   " "Y: %.4f " % (location[0], location[1])) - # self.ui.rel_position_label.setText("Dx: %.4f   Dy: " - # "%.4f    " % (self.dx, self.dy)) + self.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (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(" X: %.4f   " "Y: %.4f " % (pos[0], pos[1])) - # self.ui.rel_position_label.setText("Dx: %.4f   Dy: " - # "%.4f    " % (self.dx, self.dy)) + self.ui.rel_position_label.setText("Dx: %.4f   Dy: " + "%.4f    " % (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() diff --git a/defaults.py b/defaults.py index 747d1b7f..77eab633 100644 --- a/defaults.py +++ b/defaults.py @@ -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',