diff --git a/CHANGELOG.md b/CHANGELOG.md index 16d8fb05..5e53c371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ CHANGELOG for FlatCAM Evo beta - updated some custom widgets in the GUI elements such that the scrolling in the Preferences can be done without blocking on some of the widgets - remade how the Preferences Tab is constructed such that now is made on demand for each section (tab) therefore making it faster to load (once a section is loaded - by clicking its tab - it will not be reloaded in the current session) - a fix for the latest change in the Preferences Tab +- some changes in the Geometry Editor UI's and in some cases, fixes for the right-click close action 19.04.2022 diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index c32d2e89..cc6839f4 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -3003,6 +3003,9 @@ class FCPaint(FCShapeTool): self.origin = (0, 0) self.draw_app.paint_tool.run() + def clean_up(self): + pass + class FCTransform(FCShapeTool): def __init__(self, draw_app): @@ -3016,6 +3019,9 @@ class FCTransform(FCShapeTool): self.origin = (0, 0) self.draw_app.transform_tool.run() + def clean_up(self): + pass + # ############################################### # ################ Main Application ############# diff --git a/appEditors/geo_plugins/GeoCirclePlugin.py b/appEditors/geo_plugins/GeoCirclePlugin.py index 5b86414c..bf45b5aa 100644 --- a/appEditors/geo_plugins/GeoCirclePlugin.py +++ b/appEditors/geo_plugins/GeoCirclePlugin.py @@ -187,48 +187,70 @@ class CircleEditorUI: self.circle_tool_box.addLayout(grid0) # Position - self.pos_lbl = FCLabel('%s' % _("Position"), bold=True) + self.pos_lbl = FCLabel('%s' % _("Position"), color='red', bold=True) grid0.addWidget(self.pos_lbl, 0, 0, 1, 3) + # ############################################################################################################# + # Position Frame + # ############################################################################################################# + pos_frame = FCFrame() + grid0.addWidget(pos_frame, 2, 0, 1, 2) + + pos_grid = GLay(v_spacing=5, h_spacing=3) + pos_frame.setLayout(pos_grid) + # X Pos self.x_lbl = FCLabel('%s:' % _("X")) self.x_entry = FCDoubleSpinner() self.x_entry.set_precision(self.decimals) self.x_entry.set_range(-10000.0000, 10000.0000) - grid0.addWidget(self.x_lbl, 2, 0) - grid0.addWidget(self.x_entry, 2, 1, 1, 2) + pos_grid.addWidget(self.x_lbl, 0, 0) + pos_grid.addWidget(self.x_entry, 0, 1, 1, 2) # Y Pos self.y_lbl = FCLabel('%s:' % _("Y")) self.y_entry = FCDoubleSpinner() self.y_entry.set_precision(self.decimals) self.y_entry.set_range(-10000.0000, 10000.0000) - grid0.addWidget(self.y_lbl, 4, 0) - grid0.addWidget(self.y_entry, 4, 1, 1, 2) + pos_grid.addWidget(self.y_lbl, 2, 0) + pos_grid.addWidget(self.y_entry, 2, 1, 1, 2) + + # Radius + self.radius_lbl = FCLabel('%s' % _("Radius"), bold=True, color='blue') + grid0.addWidget(self.radius_lbl, 4, 0) + + # ############################################################################################################# + # Radius Frame + # ############################################################################################################# + rad_frame = FCFrame() + grid0.addWidget(rad_frame, 6, 0, 1, 2) + + rad_grid = GLay(v_spacing=5, h_spacing=3) + rad_frame.setLayout(rad_grid) # Radius X - self.radius_x_lbl = FCLabel('%s X:' % _("Radius")) + self.radius_x_lbl = FCLabel('%s:' % "X") self.radius_x_entry = FCDoubleSpinner() self.radius_x_entry.set_precision(self.decimals) self.radius_x_entry.set_range(0.0000, 10000.0000) - grid0.addWidget(self.radius_x_lbl, 6, 0) - grid0.addWidget(self.radius_x_entry, 6, 1) + rad_grid.addWidget(self.radius_x_lbl, 0, 0) + rad_grid.addWidget(self.radius_x_entry, 0, 1) # Radius Y - self.radius_y_lbl = FCLabel('%s Y:' % _("Radius")) + self.radius_y_lbl = FCLabel('%s:' % "Y") self.radius_y_entry = FCDoubleSpinner() self.radius_y_entry.set_precision(self.decimals) self.radius_y_entry.set_range(0.0000, 10000.0000) - grid0.addWidget(self.radius_y_lbl, 7, 0) - grid0.addWidget(self.radius_y_entry, 7, 1) + rad_grid.addWidget(self.radius_y_lbl, 1, 0) + rad_grid.addWidget(self.radius_y_entry, 1, 1) # Angle self.angle_lbl = FCLabel('%s:' % _("Angle")) self.angle_entry = FCDoubleSpinner() self.angle_entry.set_precision(self.decimals) self.angle_entry.set_range(0.0000, 360.0000) - grid0.addWidget(self.angle_lbl, 8, 0) - grid0.addWidget(self.angle_entry, 8, 1) + rad_grid.addWidget(self.angle_lbl, 2, 0) + rad_grid.addWidget(self.angle_entry, 2, 1) # Radius link self.radius_link_btn = QtWidgets.QToolButton() @@ -236,13 +258,15 @@ class CircleEditorUI: self.radius_link_btn.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Expanding) self.radius_link_btn.setCheckable(True) - grid0.addWidget(self.radius_link_btn, 6, 2, 3, 1) + rad_grid.addWidget(self.radius_link_btn, 0, 2, 3, 1) # Buttons self.add_button = FCButton(_("Add")) self.add_button.setIcon(QtGui.QIcon(self.app.resource_location + '/plus16.png')) grid0.addWidget(self.add_button, 18, 0, 1, 3) + GLay.set_common_column_size([grid0, pos_grid, rad_grid], 0) + self.layout.addStretch(1) # Note @@ -256,14 +280,14 @@ class CircleEditorUI: def on_link_checked(self, checked): if checked: - self.radius_x_lbl.set_value('%s:' % _("Radius")) + self.radius_x_lbl.set_value('%s:' % _("Value")) self.radius_y_lbl.setDisabled(True) self.radius_y_entry.setDisabled(True) self.radius_y_entry.set_value(self.radius_x_entry.get_value()) self.angle_lbl.setDisabled(True) self.angle_entry.setDisabled(True) else: - self.radius_x_lbl.set_value('%s X:' % _("Radius")) + self.radius_x_lbl.set_value('%s:' % "X") self.radius_y_lbl.setDisabled(False) self.radius_y_entry.setDisabled(False) self.angle_lbl.setDisabled(False) diff --git a/appEditors/geo_plugins/GeoRectanglePlugin.py b/appEditors/geo_plugins/GeoRectanglePlugin.py index d76a9aed..6815767d 100644 --- a/appEditors/geo_plugins/GeoRectanglePlugin.py +++ b/appEditors/geo_plugins/GeoRectanglePlugin.py @@ -219,8 +219,20 @@ class RectangleEditorUI: grid0 = GLay(v_spacing=5, h_spacing=3) self.rect_tool_box.addLayout(grid0) + # Position + self.pos_lbl = FCLabel('%s' % _("Position"), bold=True, color='red') + grid0.addWidget(self.pos_lbl, 0, 0, 1, 2) + # ############################################################################################################# + # Position Frame + # ############################################################################################################# + pos_frame = FCFrame() + grid0.addWidget(pos_frame, 2, 0, 1, 2) + + pos_grid = GLay(v_spacing=5, h_spacing=3) + pos_frame.setLayout(pos_grid) + # Anchor - self.anchor_lbl = FCLabel('%s:' % _("Anchor"), bold=True) + self.anchor_lbl = FCLabel('%s:' % _("Anchor"), bold=False) choices = [ {"label": _("T Left"), "value": "tl"}, {"label": _("T Right"), "value": "tr"}, @@ -229,31 +241,38 @@ class RectangleEditorUI: {"label": _("Center"), "value": "c"} ] self.anchor_radio = RadioSetCross(choices, compact=True) - grid0.addWidget(self.anchor_lbl, 0, 0) - grid0.addWidget(self.anchor_radio, 0, 1) - - # Position - self.pos_lbl = FCLabel('%s' % _("Position"), bold=True) - grid0.addWidget(self.pos_lbl, 2, 0, 1, 2) + pos_grid.addWidget(self.anchor_lbl, 0, 0) + pos_grid.addWidget(self.anchor_radio, 0, 1) # X Pos self.x_lbl = FCLabel('%s:' % _("X")) self.x_entry = FCDoubleSpinner() self.x_entry.set_precision(self.decimals) self.x_entry.set_range(-10000.0000, 10000.0000) - grid0.addWidget(self.x_lbl, 4, 0) - grid0.addWidget(self.x_entry, 4, 1) + pos_grid.addWidget(self.x_lbl, 2, 0) + pos_grid.addWidget(self.x_entry, 2, 1) # Y Pos self.y_lbl = FCLabel('%s:' % _("Y")) self.y_entry = FCDoubleSpinner() self.y_entry.set_precision(self.decimals) self.y_entry.set_range(-10000.0000, 10000.0000) - grid0.addWidget(self.y_lbl, 6, 0) - grid0.addWidget(self.y_entry, 6, 1) + pos_grid.addWidget(self.y_lbl, 4, 0) + pos_grid.addWidget(self.y_entry, 4, 1) + + self.corner_lbl = FCLabel('%s' % _("Corner"), bold=True, color='green') + grid0.addWidget(self.corner_lbl, 4, 0, 1, 2) + # ############################################################################################################# + # Corner Frame + # ############################################################################################################# + cor_frame = FCFrame() + grid0.addWidget(cor_frame, 6, 0, 1, 2) + + cor_grid = GLay(v_spacing=5, h_spacing=3) + cor_frame.setLayout(cor_grid) # Corner Type - self.corner_lbl = FCLabel('%s:' % _("Corner")) + self.corner_lbl = FCLabel('%s:' % _("Type")) self.corner_lbl.setToolTip( _("There are 3 types of corners:\n" " - 'Round': the corners are rounded\n" @@ -265,38 +284,47 @@ class RectangleEditorUI: {'label': _('Square'), 'value': 's'}, {'label': _('Beveled'), 'value': 'b'}, ], orientation='vertical', compact=True) - grid0.addWidget(self.corner_lbl, 8, 0) - grid0.addWidget(self.corner_radio, 8, 1) + cor_grid.addWidget(self.corner_lbl, 0, 0) + cor_grid.addWidget(self.corner_radio, 0, 1) # Radius self.radius_lbl = FCLabel('%s:' % _("Radius")) self.radius_entry = FCDoubleSpinner() self.radius_entry.set_precision(self.decimals) self.radius_entry.set_range(0.0000, 10000.0000) - grid0.addWidget(self.radius_lbl, 10, 0) - grid0.addWidget(self.radius_entry, 10, 1) + cor_grid.addWidget(self.radius_lbl, 2, 0) + cor_grid.addWidget(self.radius_entry, 2, 1) # Size - self.size_lbl = FCLabel('%s' % _("Size"), bold=True) - grid0.addWidget(self.size_lbl, 12, 0, 1, 2) + self.size_lbl = FCLabel('%s' % _("Size"), bold=True, color='indigo') + grid0.addWidget(self.size_lbl, 8, 0, 1, 2) + # ############################################################################################################# + # Size Frame + # ############################################################################################################# + size_frame = FCFrame() + grid0.addWidget(size_frame, 10, 0, 1, 2) + + size_grid = GLay(v_spacing=5, h_spacing=3) + size_frame.setLayout(size_grid) # Length self.length_lbl = FCLabel('%s:' % _("Length")) self.length_entry = NumericalEvalEntry() - grid0.addWidget(self.length_lbl, 14, 0) - grid0.addWidget(self.length_entry, 14, 1) + size_grid.addWidget(self.length_lbl, 0, 0) + size_grid.addWidget(self.length_entry, 0, 1) # Width self.width_lbl = FCLabel('%s:' % _("Width")) self.width_entry = NumericalEvalEntry() - grid0.addWidget(self.width_lbl, 16, 0) - grid0.addWidget(self.width_entry, 16, 1) + size_grid.addWidget(self.width_lbl, 2, 0) + size_grid.addWidget(self.width_entry, 2, 1) # Buttons self.add_button = FCButton(_("Add")) self.add_button.setIcon(QtGui.QIcon(self.app.resource_location + '/plus16.png')) grid0.addWidget(self.add_button, 18, 0, 1, 2) + GLay.set_common_column_size([grid0, pos_grid, cor_grid, size_grid], 0) self.layout.addStretch(1) # Note diff --git a/appEditors/geo_plugins/GeoSimplificationPlugin.py b/appEditors/geo_plugins/GeoSimplificationPlugin.py index adcd898d..cc89b1e1 100644 --- a/appEditors/geo_plugins/GeoSimplificationPlugin.py +++ b/appEditors/geo_plugins/GeoSimplificationPlugin.py @@ -196,40 +196,49 @@ class SimplificationEditorUI: self.simp_tools_box.addLayout(grid0) # Coordinates - coords_lbl = FCLabel('%s' % _("Coordinates"), bold=True) + coords_lbl = FCLabel('%s' % _("Coordinates"), bold=True, color='red') coords_lbl.setToolTip( _("The coordinates of the selected geometry element.") ) - grid0.addWidget(coords_lbl, 22, 0, 1, 3) + grid0.addWidget(coords_lbl, 0, 0, 1, 2) + + # ############################################################################################################# + # Coordinates Frame + # ############################################################################################################# + coors_frame = FCFrame() + grid0.addWidget(coors_frame, 2, 0, 1, 2) + + coords_grid = GLay(v_spacing=5, h_spacing=3) + coors_frame.setLayout(coords_grid) self.geo_coords_entry = FCTextEdit() self.geo_coords_entry.setPlaceholderText( _("The coordinates of the selected geometry element.") ) - grid0.addWidget(self.geo_coords_entry, 24, 0, 1, 3) + coords_grid.addWidget(self.geo_coords_entry, 0, 0, 1, 2) # Vertex Points Number - vertex_lbl = FCLabel('%s' % _("Vertex Points"), bold=True) + vertex_lbl = FCLabel('%s:' % _("Vertex Points"), bold=False) vertex_lbl.setToolTip( _("The number of vertex points in the selected geometry element.") ) self.geo_vertex_entry = FCEntry(decimals=self.decimals) self.geo_vertex_entry.setReadOnly(True) - grid0.addWidget(vertex_lbl, 26, 0) - grid0.addWidget(self.geo_vertex_entry, 26, 1, 1, 2) - - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 28, 0, 1, 3) + coords_grid.addWidget(vertex_lbl, 2, 0) + coords_grid.addWidget(self.geo_vertex_entry, 2, 1) # Simplification Title - simplif_lbl = FCLabel('%s' % _("Simplification"), bold=True) - simplif_lbl.setToolTip( - _("Simplify a geometry by reducing its vertex points number.") - ) - grid0.addWidget(simplif_lbl, 30, 0, 1, 3) + par_lbl = FCLabel('%s' % _("Parameters"), bold=True, color='blue') + grid0.addWidget(par_lbl, 4, 0, 1, 2) + # ############################################################################################################# + # Parameters Frame + # ############################################################################################################# + par_frame = FCFrame() + grid0.addWidget(par_frame, 6, 0, 1, 2) + + par_grid = GLay(v_spacing=5, h_spacing=3) + par_frame.setLayout(par_grid) # Simplification Tolerance simplification_tol_lbl = FCLabel('%s' % _("Tolerance"), bold=True) @@ -242,8 +251,8 @@ class SimplificationEditorUI: self.geo_tol_entry.setSingleStep(10 ** -self.decimals) self.geo_tol_entry.set_range(0.0000, 10000.0000) - grid0.addWidget(simplification_tol_lbl, 32, 0) - grid0.addWidget(self.geo_tol_entry, 32, 1, 1, 2) + par_grid.addWidget(simplification_tol_lbl, 0, 0) + par_grid.addWidget(self.geo_tol_entry, 0, 1) # Simplification button self.simplification_btn = FCButton(_("Simplify")) @@ -258,6 +267,7 @@ class SimplificationEditorUI: } """) - grid0.addWidget(self.simplification_btn, 34, 0, 1, 3) + self.layout.addWidget(self.simplification_btn) + GLay.set_common_column_size([grid0, coords_grid, par_grid], 0) self.layout.addStretch(1) diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index ee94602b..8aa2d52f 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -749,7 +749,7 @@ class MainGUI(QtWidgets.QMainWindow): '%s\t%s' % (_("Copy Geom"), _('C'))) self.geo_delete_menuitem = self.geo_editor_menu.addAction( QtGui.QIcon(self.app.resource_location + '/deleteshape16.png'), - '%s\t%s' % (_("Delete Shape"), _('DEL')) + '%s\t%s' % (_("Delete"), _('DEL')) ) self.geo_editor_menu.addSeparator() self.geo_move_menuitem = self.geo_editor_menu.addAction( @@ -1297,7 +1297,7 @@ class MainGUI(QtWidgets.QMainWindow): QtGui.QIcon(self.app.resource_location + '/copy32.png'), _("Copy Shape(s)")) self.geo_delete_btn = self.geo_edit_toolbar.addAction( - QtGui.QIcon(self.app.resource_location + '/trash32.png'), _("Delete Shape")) + QtGui.QIcon(self.app.resource_location + '/trash32.png'), _("Delete")) self.geo_transform_btn = self.geo_edit_toolbar.addAction( QtGui.QIcon(self.app.resource_location + '/transform.png'), _("Transformations")) self.geo_edit_toolbar.addSeparator() @@ -2665,7 +2665,7 @@ class MainGUI(QtWidgets.QMainWindow): self.geo_copy_btn = self.geo_edit_toolbar.addAction( QtGui.QIcon(self.app.resource_location + '/copy32.png'), _("Copy Objects")) self.geo_delete_btn = self.geo_edit_toolbar.addAction( - QtGui.QIcon(self.app.resource_location + '/trash32.png'), _("Delete Shape")) + QtGui.QIcon(self.app.resource_location + '/trash32.png'), _("Delete")) self.geo_transform_btn = self.geo_edit_toolbar.addAction( QtGui.QIcon(self.app.resource_location + '/transform.png'), _("Transformations")) @@ -5247,7 +5247,7 @@ class ShortcutsTab(QtWidgets.QWidget): _('Space'), _("Rotate Geometry"), _('ENTER'), _("Finish drawing for certain tools"), _('Esc'), _("Abort and return to Select"), - _('Del'), _("Delete Shape") + _('Del'), _("Delete") ) # EXCELLON EDITOR SHORTCUT LIST