From 241579d670703431abd70f866888783b6654a599 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 9 Sep 2021 16:28:14 +0300 Subject: [PATCH] - on Coppper Thieving Plugin some UI updates - updated the GCGridLayout GUi element to automatically stretch the first column but offered also configuration; updated the use throughout the app --- .gitignore | 3 +- Bookmark.py | 2 - CHANGELOG.md | 2 + appDatabase.py | 16 -- appEditors/AppExcEditor.py | 18 -- appEditors/AppGeoEditor.py | 15 +- appEditors/AppGerberEditor.py | 24 +-- appEditors/appGCodeEditor.py | 4 +- appGUI/GUIElements.py | 25 ++- appGUI/ObjectUI.py | 31 +-- appGUI/preferences/OptionsGroupUI.py | 2 - appGUI/preferences/PreferencesUIManager.py | 6 +- .../cncjob/CNCJobAdvOptPrefGroupUI.py | 2 - .../cncjob/CNCJobGenPrefGroupUI.py | 2 - .../cncjob/CNCJobOptPrefGroupUI.py | 2 - .../excellon/ExcellonAdvOptPrefGroupUI.py | 2 - .../excellon/ExcellonExpPrefGroupUI.py | 2 - .../excellon/ExcellonGenPrefGroupUI.py | 2 - .../excellon/ExcellonOptPrefGroupUI.py | 2 - .../general/GeneralAPPSetGroupUI.py | 2 - .../general/GeneralAppPrefGroupUI.py | 2 - .../general/GeneralGUIPrefGroupUI.py | 2 - .../geometry/GeometryAdvOptPrefGroupUI.py | 2 - .../geometry/GeometryExpPrefGroupUI.py | 2 - .../geometry/GeometryGenPrefGroupUI.py | 2 - .../geometry/GeometryOptPrefGroupUI.py | 2 - .../gerber/GerberExpPrefGroupUI.py | 2 - .../tools/Tools2CThievingPrefGroupUI.py | 190 +++++++++++------- .../preferences/tools/Tools2CalPrefGroupUI.py | 2 - .../tools/Tools2ExtractPrefGroupUI.py | 2 - .../tools/Tools2FiducialsPrefGroupUI.py | 4 - .../tools/Tools2InvertPrefGroupUI.py | 2 - .../tools/Tools2OptimalPrefGroupUI.py | 2 - .../tools/Tools2PunchGerberPrefGroupUI.py | 2 - .../tools/Tools2QRCodePrefGroupUI.py | 2 - .../tools/Tools2RulesCheckPrefGroupUI.py | 2 - .../tools/ToolsCalculatorsPrefGroupUI.py | 2 - .../tools/ToolsCornersPrefGroupUI.py | 2 - .../preferences/tools/ToolsFilmPrefGroupUI.py | 8 - .../tools/ToolsLevelPrefGroupUI.py | 2 - .../tools/ToolsPaintPrefGroupUI.py | 2 - .../tools/ToolsPanelizePrefGroupUI.py | 2 - .../tools/ToolsTransformPrefGroupUI.py | 2 - appPlugins/ToolAlignObjects.py | 6 - appPlugins/ToolCalculators.py | 8 - appPlugins/ToolCalibration.py | 5 +- appPlugins/ToolCopperThieving.py | 143 ++++++------- appPlugins/ToolCorners.py | 6 - appPlugins/ToolCutOut.py | 8 - appPlugins/ToolDblSided.py | 8 - appPlugins/ToolDistance.py | 2 - appPlugins/ToolDistanceMin.py | 2 - appPlugins/ToolDrilling.py | 12 +- appPlugins/ToolEtchCompensation.py | 4 - appPlugins/ToolExtract.py | 17 +- appPlugins/ToolFiducials.py | 4 - appPlugins/ToolFilm.py | 10 - appPlugins/ToolFollow.py | 2 - appPlugins/ToolImage.py | 2 - appPlugins/ToolInvertGerber.py | 2 - appPlugins/ToolIsolation.py | 8 - appPlugins/ToolLevelling.py | 14 +- appPlugins/ToolMilling.py | 14 -- appPlugins/ToolNCC.py | 10 - appPlugins/ToolOptimal.py | 2 - appPlugins/ToolPaint.py | 10 - appPlugins/ToolPanelize.py | 8 - appPlugins/ToolPcbWizard.py | 4 - appPlugins/ToolPunchGerber.py | 13 +- appPlugins/ToolQRCode.py | 8 - appPlugins/ToolRulesCheck.py | 8 +- appPlugins/ToolSolderPaste.py | 6 - appPlugins/ToolSub.py | 7 +- appPlugins/ToolTransform.py | 5 +- app_Main.py | 16 +- 75 files changed, 222 insertions(+), 558 deletions(-) diff --git a/.gitignore b/.gitignore index ce33b515..164ed709 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.pyc .idea/ tests/tmp/ -build/ \ No newline at end of file +build/ +/venv/ diff --git a/Bookmark.py b/Bookmark.py index 492ce18f..3f0eca71 100644 --- a/Bookmark.py +++ b/Bookmark.py @@ -79,8 +79,6 @@ class BookmarkManager(QtWidgets.QWidget): new_vlay.addWidget(new_title_lbl) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) new_vlay.addLayout(grid0) title_lbl = FCLabel('%s:' % _("Title")) diff --git a/CHANGELOG.md b/CHANGELOG.md index d176658d..21ff6475 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ CHANGELOG for FlatCAM beta - in Levelling Plugin added a check that allow levelling only for CNC Job objects resulted from Geometry - some minor changes - updated the language strings +- on Coppper Thieving Plugin some UI updates +- updated the GCGridLayout GUi element to automatically stretch the first column but offered also configuration; updated the use throughout the app 8.09.2021 diff --git a/appDatabase.py b/appDatabase.py index 10bdb6ae..cbaa7d83 100644 --- a/appDatabase.py +++ b/appDatabase.py @@ -195,8 +195,6 @@ class ToolsDB2UI: # ########################################################################### self.grid_tool = FCGridLayout(v_spacing=5, h_spacing=3) self.description_vlay.addLayout(self.grid_tool) - self.grid_tool.setColumnStretch(0, 0) - self.grid_tool.setColumnStretch(1, 1) self.description_vlay.addStretch() # Tool Name @@ -279,8 +277,6 @@ class ToolsDB2UI: # ########################################################################### self.grid0 = FCGridLayout(v_spacing=5, h_spacing=3) self.milling_vlay.addLayout(self.grid0) - self.grid0.setColumnStretch(0, 0) - self.grid0.setColumnStretch(1, 1) self.milling_vlay.addStretch() # Tool Shape @@ -578,8 +574,6 @@ class ToolsDB2UI: self.grid2 = FCGridLayout(v_spacing=5, h_spacing=3) self.ncc_vlay.addLayout(self.grid2) - self.grid2.setColumnStretch(0, 0) - self.grid2.setColumnStretch(1, 1) self.ncc_vlay.addStretch() # Operation @@ -724,8 +718,6 @@ class ToolsDB2UI: self.grid3 = FCGridLayout(v_spacing=5, h_spacing=3) self.paint_vlay.addLayout(self.grid3) - self.grid3.setColumnStretch(0, 0) - self.grid3.setColumnStretch(1, 1) self.paint_vlay.addStretch() # Overlap @@ -813,8 +805,6 @@ class ToolsDB2UI: self.grid4 = FCGridLayout(v_spacing=5, h_spacing=3) self.iso_vlay.addLayout(self.grid4) - self.grid4.setColumnStretch(0, 0) - self.grid4.setColumnStretch(1, 1) self.iso_vlay.addStretch() # Passes @@ -890,8 +880,6 @@ class ToolsDB2UI: # ########################################################################### self.grid5 = FCGridLayout(v_spacing=5, h_spacing=3) self.drill_vlay.addLayout(self.grid5) - self.grid5.setColumnStretch(0, 0) - self.grid5.setColumnStretch(1, 1) self.drill_vlay.addStretch() # Cut Z @@ -1115,8 +1103,6 @@ class ToolsDB2UI: # ########################################################################### self.grid6 = FCGridLayout(v_spacing=5, h_spacing=3) self.cutout_vlay.addLayout(self.grid6) - self.grid6.setColumnStretch(0, 0) - self.grid6.setColumnStretch(1, 1) self.cutout_vlay.addStretch() # Margin @@ -1400,8 +1386,6 @@ class ToolsDB2(QtWidgets.QWidget): # ############################################################################## # ############################################################################## layout = FCGridLayout(v_spacing=5, h_spacing=3) - layout.setColumnStretch(0, 0) - layout.setColumnStretch(1, 1) self.setLayout(layout) self.ui = ToolsDB2UI(app=self.app, grid_layout=layout) diff --git a/appEditors/AppExcEditor.py b/appEditors/AppExcEditor.py index 261783f6..28777b8e 100644 --- a/appEditors/AppExcEditor.py +++ b/appEditors/AppExcEditor.py @@ -4063,8 +4063,6 @@ class AppExcEditorUI: # ######################## ADD New Tool Grid ################################################################## # ############################################################################################################# grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) self.ui_vertical_lay.addLayout(grid1) # Tool Diameter Label @@ -4117,8 +4115,6 @@ class AppExcEditorUI: self.ui_vertical_lay.addWidget(self.resize_frame) self.resize_grid = FCGridLayout(v_spacing=5, h_spacing=3) - self.resize_grid.setColumnStretch(0, 0) - self.resize_grid.setColumnStretch(1, 1) self.resize_grid.setContentsMargins(0, 0, 0, 0) self.resize_frame.setLayout(self.resize_grid) @@ -4173,8 +4169,6 @@ class AppExcEditorUI: self.ui_vertical_lay.addWidget(self.array_frame) self.array_grid = FCGridLayout(v_spacing=5, h_spacing=3) - self.array_grid.setColumnStretch(0, 0) - self.array_grid.setColumnStretch(1, 1) self.array_grid.setContentsMargins(0, 0, 0, 0) self.array_frame.setLayout(self.array_grid) @@ -4216,8 +4210,6 @@ class AppExcEditorUI: self.array_linear_frame.setContentsMargins(0, 0, 0, 0) self.array_grid.addWidget(self.array_linear_frame, 6, 0, 1, 2) self.lin_grid = FCGridLayout(v_spacing=5, h_spacing=3) - self.lin_grid.setColumnStretch(0, 0) - self.lin_grid.setColumnStretch(1, 1) self.lin_grid.setContentsMargins(0, 0, 0, 0) self.array_linear_frame.setLayout(self.lin_grid) @@ -4275,8 +4267,6 @@ class AppExcEditorUI: self.array_grid.addWidget(self.array_circular_frame, 8, 0, 1, 2) self.circ_grid = FCGridLayout(v_spacing=5, h_spacing=3) - self.circ_grid.setColumnStretch(0, 0) - self.circ_grid.setColumnStretch(1, 1) self.circ_grid.setContentsMargins(0, 0, 0, 0) self.array_circular_frame.setLayout(self.circ_grid) @@ -4319,8 +4309,6 @@ class AppExcEditorUI: self.ui_vertical_lay.addWidget(self.slot_frame) self.slot_grid = FCGridLayout(v_spacing=5, h_spacing=3) - self.slot_grid.setColumnStretch(0, 0) - self.slot_grid.setColumnStretch(1, 1) self.slot_grid.setContentsMargins(0, 0, 0, 0) self.slot_frame.setLayout(self.slot_grid) @@ -4393,8 +4381,6 @@ class AppExcEditorUI: self.ui_vertical_lay.addWidget(self.slot_array_frame) self.slot_array_grid = FCGridLayout(v_spacing=5, h_spacing=3) - self.slot_array_grid.setColumnStretch(0, 0) - self.slot_array_grid.setColumnStretch(1, 1) self.slot_array_grid.setContentsMargins(0, 0, 0, 0) self.slot_array_frame.setLayout(self.slot_array_grid) @@ -4437,8 +4423,6 @@ class AppExcEditorUI: self.slot_array_grid.addWidget(self.slot_array_linear_frame, 6, 0, 1, 2) self.slot_array_lin_grid = FCGridLayout(v_spacing=5, h_spacing=3) - self.slot_array_lin_grid.setColumnStretch(0, 0) - self.slot_array_lin_grid.setColumnStretch(1, 1) self.slot_array_lin_grid.setContentsMargins(0, 0, 0, 0) self.slot_array_linear_frame.setLayout(self.slot_array_lin_grid) @@ -4497,8 +4481,6 @@ class AppExcEditorUI: self.slot_array_grid.addWidget(self.slot_array_circular_frame, 8, 0, 1, 2) self.slot_array_circ_grid = FCGridLayout(v_spacing=5, h_spacing=3) - self.slot_array_circ_grid.setColumnStretch(0, 0) - self.slot_array_circ_grid.setColumnStretch(1, 1) self.slot_array_circ_grid.setContentsMargins(0, 0, 0, 0) self.slot_array_circular_frame.setLayout(self.slot_array_circ_grid) diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index a7a24598..036dc4d5 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -84,8 +84,6 @@ class BufferSelectionTool(AppTool): # Grid Layout grid_buffer = FCGridLayout(v_spacing=5, h_spacing=3) - grid_buffer.setColumnStretch(0, 0) - grid_buffer.setColumnStretch(1, 1) self.buffer_tools_box.addLayout(grid_buffer) # Buffer distance @@ -268,8 +266,6 @@ class TextInputTool(AppTool): # Grid Layout self.grid_text = FCGridLayout(v_spacing=5, h_spacing=3) - self.grid_text.setColumnStretch(0, 0) - self.grid_text.setColumnStretch(1, 1) self.text_tools_box.addLayout(self.grid_text) # Font type @@ -507,8 +503,6 @@ class PaintOptionsTool(AppTool): grid = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid) - grid.setColumnStretch(0, 0) - grid.setColumnStretch(1, 1) # Tool dia ptdlabel = FCLabel('%s:' % _('Tool Dia')) @@ -735,11 +729,8 @@ class TransformEditorTool(AppTool): self.layout.addWidget(FCLabel('')) # ## Layout - grid0 = FCGridLayout(v_spacing=5, h_spacing=3) + grid0 = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) - grid0.setColumnStretch(2, 0) grid0.addWidget(FCLabel('')) @@ -3458,8 +3449,6 @@ class AppGeoEditor(QtCore.QObject): self.title_box.addWidget(self.level) self.grid_d = FCGridLayout(v_spacing=5, h_spacing=3) - self.grid_d.setColumnStretch(0, 0) - self.grid_d.setColumnStretch(1, 1) self.tools_box.addLayout(self.grid_d) # Tool diameter @@ -3502,8 +3491,6 @@ class AppGeoEditor(QtCore.QObject): self.tools_box.addWidget(self.adv_frame) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) grid0.setContentsMargins(0, 0, 0, 0) self.adv_frame.setLayout(grid0) diff --git a/appEditors/AppGerberEditor.py b/appEditors/AppGerberEditor.py index ff96fd70..377b2d1d 100644 --- a/appEditors/AppGerberEditor.py +++ b/appEditors/AppGerberEditor.py @@ -6094,8 +6094,6 @@ class AppGerberEditorUI: # ############################################################################################################# grid1 = FCGridLayout(v_spacing=5, h_spacing=3) self.apertures_box.addLayout(grid1) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) # Title apadd_del_lbl = FCLabel('%s:' % _('Add/Delete Aperture')) @@ -6194,8 +6192,6 @@ class AppGerberEditorUI: self.custom_box.addWidget(self.shape_frame) self.shape_grid = FCGridLayout(v_spacing=5, h_spacing=3) - self.shape_grid.setColumnStretch(0, 0) - self.shape_grid.setColumnStretch(1, 1) self.shape_grid.setContentsMargins(0, 0, 0, 0) self.shape_frame.setLayout(self.shape_grid) @@ -6215,12 +6211,7 @@ class AppGerberEditorUI: ) self.shape_grid.addWidget(param_title, 4, 0, 1, 3) - p_grid = FCGridLayout(v_spacing=5, h_spacing=3) - p_grid.setColumnStretch(0, 0) - p_grid.setColumnStretch(1, 0) - p_grid.setColumnStretch(2, 0) - p_grid.setColumnStretch(3, 1) - p_grid.setColumnStretch(4, 0) + p_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 0, 0, 1, 0]) # Is Valid valid_lbl = FCLabel('%s:' % _("Valid")) @@ -6333,8 +6324,6 @@ class AppGerberEditorUI: # Grid Layout buff_grid = FCGridLayout(v_spacing=5, h_spacing=3) - buff_grid.setColumnStretch(0, 0) - buff_grid.setColumnStretch(1, 1) self.buffer_tools_box.addLayout(buff_grid) # Buffer distance @@ -6393,8 +6382,6 @@ class AppGerberEditorUI: # Grid Layout scale_grid = FCGridLayout(v_spacing=5, h_spacing=3) - scale_grid.setColumnStretch(0, 0) - scale_grid.setColumnStretch(1, 1) self.scale_tools_box.addLayout(scale_grid) self.scale_factor_lbl = FCLabel('%s:' % _("Scale factor")) @@ -6444,8 +6431,6 @@ class AppGerberEditorUI: # Form Layout mark_grid = FCGridLayout(v_spacing=5, h_spacing=3) - mark_grid.setColumnStretch(0, 0) - mark_grid.setColumnStretch(1, 1) self.ma_tools_box.addLayout(mark_grid) # Upper Threshold @@ -6515,8 +6500,6 @@ class AppGerberEditorUI: self.array_box.addWidget(separator_line) array_grid = FCGridLayout(v_spacing=5, h_spacing=3) - array_grid.setColumnStretch(0, 0) - array_grid.setColumnStretch(1, 1) self.array_box.addLayout(array_grid) # Title @@ -6691,11 +6674,8 @@ class TransformEditorTool(AppTool): self.layout.addWidget(FCLabel('')) # ## Layout - grid0 = FCGridLayout(v_spacing=5, h_spacing=3) + grid0 = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) - grid0.setColumnStretch(2, 0) grid0.addWidget(FCLabel('')) diff --git a/appEditors/appGCodeEditor.py b/appEditors/appGCodeEditor.py index b3bd8611..14f848dc 100644 --- a/appEditors/appGCodeEditor.py +++ b/appEditors/appGCodeEditor.py @@ -827,9 +827,7 @@ class AppGCodeEditorUI: self.snippet_frame.setContentsMargins(0, 0, 0, 0) self.edit_box.addWidget(self.snippet_frame) - self.snippet_grid = FCGridLayout(v_spacing=5, h_spacing=3) - # self.snippet_grid.setColumnStretch(0, 0) - # self.snippet_grid.setColumnStretch(1, 1) + self.snippet_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 0]) self.snippet_grid.setContentsMargins(0, 0, 0, 0) self.snippet_frame.setLayout(self.snippet_grid) diff --git a/appGUI/GUIElements.py b/appGUI/GUIElements.py index c6c54aa5..9e1968f8 100644 --- a/appGUI/GUIElements.py +++ b/appGUI/GUIElements.py @@ -3990,8 +3990,6 @@ class DialogBoxRadio(QtWidgets.QDialog): self.setWindowTitle(str(title)) grid0 = FCGridLayout(parent=self, h_spacing=5, v_spacing=5) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.ref_label = FCLabel('%s:' % _("Reference")) self.ref_label.setToolTip( @@ -4901,10 +4899,8 @@ class FCZeroAxes(QtWidgets.QFrame): self.setLineWidth(1) # Zero the axes - grbl_zero_grid = FCGridLayout(v_spacing=5, h_spacing=3) + grbl_zero_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0,0]) grbl_zero_grid.setContentsMargins(2, 4, 2, 4) - grbl_zero_grid.setColumnStretch(0, 0) - grbl_zero_grid.setColumnStretch(1, 0) # grbl_zero_grid.setRowStretch(4, 1) self.setLayout(grbl_zero_grid) @@ -5276,10 +5272,19 @@ class FCGridLayout(QtWidgets.QGridLayout): This class create the Sys Tray icon for the app """ - def __init__(self, v_spacing=None, h_spacing=None, margins=None, *args, parent=None): + def __init__(self, *args, v_spacing=None, h_spacing=None, c_stretch=None, margins=None, parent=None): """ Class that makes a custom grid layout + :param args: + :param v_spacing: vertical spacing + :type v_spacing: int + :param h_spacing: horizontal spacing + :type h_spacing: int + :param c_stretch: columns stretching + :type c_stretch: list + :param margins: content margins + :type margins: list :param parent: """ @@ -5293,6 +5298,14 @@ class FCGridLayout(QtWidgets.QGridLayout): self.setVerticalSpacing(v_spacing) if margins is not None: self.setContentsMargins(margins[0], margins[1], margins[2], margins[3]) + + if c_stretch is None: + self.setColumnStretch(0, 0) + self.setColumnStretch(1, 1) + elif c_stretch and isinstance(c_stretch, (tuple, list)): + for idx, val in enumerate(c_stretch): + self.setColumnStretch(idx, val) + self.blockSignals(False) diff --git a/appGUI/ObjectUI.py b/appGUI/ObjectUI.py index 9e421a4b..ec733cd3 100644 --- a/appGUI/ObjectUI.py +++ b/appGUI/ObjectUI.py @@ -195,8 +195,6 @@ class GerberObjectUI(ObjectUI): # Plot options grid0 = FCGridLayout(v_spacing=5, h_spacing=3) grid0.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) gen_frame.setLayout(grid0) self.plot_options_label = FCLabel("%s:" % _("Plot Options")) @@ -295,8 +293,6 @@ class GerberObjectUI(ObjectUI): # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) self.tt_frame.setLayout(grid1) # ### Gerber Apertures #### @@ -493,8 +489,6 @@ class GerberObjectUI(ObjectUI): self.util_box.addWidget(ncc_frame) grid_ncc = FCGridLayout(v_spacing=5, h_spacing=3) - grid_ncc.setColumnStretch(0, 0) - grid_ncc.setColumnStretch(1, 1) ncc_frame.setLayout(grid_ncc) # Margin @@ -542,8 +536,6 @@ class GerberObjectUI(ObjectUI): # Grid Layout grid_bb = FCGridLayout(v_spacing=5, h_spacing=3) - grid_bb.setColumnStretch(0, 0) - grid_bb.setColumnStretch(1, 1) bb_frame.setLayout(grid_bb) bbmargin = FCLabel('%s:' % _('Boundary Margin')) @@ -615,8 +607,6 @@ class ExcellonObjectUI(ObjectUI): # Plot options grid0 = FCGridLayout(v_spacing=5, h_spacing=3) grid0.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) gen_frame.setLayout(grid0) # Plot options @@ -700,8 +690,6 @@ class ExcellonObjectUI(ObjectUI): grid_tt = FCGridLayout(v_spacing=5, h_spacing=3) grid_tt.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) - grid_tt.setColumnStretch(0, 0) - grid_tt.setColumnStretch(1, 1) self.custom_box.addLayout(grid_tt) # Table Visibility CB @@ -855,8 +843,6 @@ class ExcellonObjectUI(ObjectUI): self.util_box.addWidget(mill_frame) grid_mill = FCGridLayout(v_spacing=5, h_spacing=3) - grid_mill.setColumnStretch(0, 0) - grid_mill.setColumnStretch(1, 1) mill_frame.setLayout(grid_mill) self.tdlabel = FCLabel('%s:' % _('Milling Diameter')) @@ -952,8 +938,6 @@ class GeometryObjectUI(ObjectUI): # Plot options grid0 = FCGridLayout(v_spacing=5, h_spacing=3) grid0.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) gen_frame.setLayout(grid0) self.plot_options_label = FCLabel("%s:" % _("Plot Options")) @@ -1033,8 +1017,6 @@ class GeometryObjectUI(ObjectUI): # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) self.tt_frame.setLayout(grid1) # ### Tools #### @@ -1189,8 +1171,6 @@ class GeometryObjectUI(ObjectUI): self.util_box.addWidget(sim_frame) grid_sim = FCGridLayout(v_spacing=5, h_spacing=3) - grid_sim.setColumnStretch(0, 0) - grid_sim.setColumnStretch(1, 1) sim_frame.setLayout(grid_sim) # Vertex Points @@ -1292,8 +1272,6 @@ class CNCObjectUI(ObjectUI): # Plot options grid0 = FCGridLayout(v_spacing=5, h_spacing=3) grid0.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) gen_frame.setLayout(grid0) # Plot Options @@ -1377,8 +1355,6 @@ class CNCObjectUI(ObjectUI): self.custom_box.addWidget(self.gp_frame) grid_par = FCGridLayout(v_spacing=5, h_spacing=3) - grid_par.setColumnStretch(0, 0) - grid_par.setColumnStretch(1, 1) self.gp_frame.setLayout(grid_par) # Travelled Distance @@ -1446,8 +1422,6 @@ class CNCObjectUI(ObjectUI): # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) self.tt_frame.setLayout(grid1) hlay = QtWidgets.QHBoxLayout() @@ -1699,10 +1673,7 @@ class DocumentObjectUI(ObjectUI): # ############ Grid LAYOUT ##################################### # ############################################################## - self.grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - self.grid0.setColumnStretch(0, 0) - self.grid0.setColumnStretch(1, 1) - self.grid0.setColumnStretch(2, 0) + self.grid0 = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) self.custom_box.addLayout(self.grid0) # Font diff --git a/appGUI/preferences/OptionsGroupUI.py b/appGUI/preferences/OptionsGroupUI.py index c6f24a3b..51ffbc12 100644 --- a/appGUI/preferences/OptionsGroupUI.py +++ b/appGUI/preferences/OptionsGroupUI.py @@ -50,8 +50,6 @@ class OptionsGroupUI2(OptionsGroupUI): self.grid = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(self.grid) - self.grid.setColumnStretch(0, 0) - self.grid.setColumnStretch(1, 1) self.options = self.build_options() diff --git a/appGUI/preferences/PreferencesUIManager.py b/appGUI/preferences/PreferencesUIManager.py index 62e34507..4387c34f 100644 --- a/appGUI/preferences/PreferencesUIManager.py +++ b/appGUI/preferences/PreferencesUIManager.py @@ -612,10 +612,10 @@ class PreferencesUIManager: "tools_copper_thieving_clearance": self.ui.plugin2_pref_form.tools2_cfill_group.clearance_entry, "tools_copper_thieving_margin": self.ui.plugin2_pref_form.tools2_cfill_group.margin_entry, "tools_copper_thieving_area": self.ui.plugin2_pref_form.tools2_cfill_group.area_entry, - "tools_copper_thieving_reference": self.ui.plugin2_pref_form.tools2_cfill_group.reference_radio, + "tools_copper_thieving_reference": self.ui.plugin2_pref_form.tools2_cfill_group.reference_combo, "tools_copper_thieving_box_type": self.ui.plugin2_pref_form.tools2_cfill_group.bbox_type_radio, "tools_copper_thieving_circle_steps": self.ui.plugin2_pref_form.tools2_cfill_group.circlesteps_entry, - "tools_copper_thieving_fill_type": self.ui.plugin2_pref_form.tools2_cfill_group.fill_type_radio, + "tools_copper_thieving_fill_type": self.ui.plugin2_pref_form.tools2_cfill_group.fill_type_combo, "tools_copper_thieving_dots_dia": self.ui.plugin2_pref_form.tools2_cfill_group.dot_dia_entry, "tools_copper_thieving_dots_spacing": self.ui.plugin2_pref_form.tools2_cfill_group.dot_spacing_entry, "tools_copper_thieving_squares_size": self.ui.plugin2_pref_form.tools2_cfill_group.square_size_entry, @@ -627,7 +627,7 @@ class PreferencesUIManager: "tools_copper_thieving_rb_thickness": self.ui.plugin2_pref_form.tools2_cfill_group.rb_thickness_entry, "tools_copper_thieving_only_apds": self.ui.plugin2_pref_form.tools2_cfill_group.only_pads_cb, "tools_copper_thieving_mask_clearance": self.ui.plugin2_pref_form.tools2_cfill_group.clearance_ppm_entry, - "tools_copper_thieving_geo_choice": self.ui.plugin2_pref_form.tools2_cfill_group.ppm_choice_radio, + "tools_copper_thieving_geo_choice": self.ui.plugin2_pref_form.tools2_cfill_group.ppm_choice_combo, # Fiducials Tool "tools_fiducials_dia": self.ui.plugin2_pref_form.tools2_fiducials_group.dia_entry, diff --git a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py index 44760d17..5ae3e2b1 100644 --- a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py @@ -21,8 +21,6 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): self.setTitle(str(_("CNC Job Adv. Options"))) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # ## Export G-Code diff --git a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py index 71d3aba6..8de10987 100644 --- a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py @@ -27,8 +27,6 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): grid0 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) # Plot CB self.plot_cb = FCCheckBox(_('Plot Object')) diff --git a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py index ebd03a26..9d736360 100644 --- a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py @@ -40,8 +40,6 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI): grid0 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) # Plot Kind self.cncplot_method_label = FCLabel('%s:' % _("Plot kind")) diff --git a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py index b71b39fa..ccc5d16e 100644 --- a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py @@ -34,8 +34,6 @@ class ExcellonAdvOptPrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.exc_label) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # Table Visibility CB diff --git a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py index 54ec07ac..e6b08097 100644 --- a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py @@ -29,8 +29,6 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.export_options_label) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # Excellon Units diff --git a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py index 82c3e142..a140abee 100644 --- a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py @@ -58,8 +58,6 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): grid2 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid2) - grid2.setColumnStretch(0, 0) - grid2.setColumnStretch(1, 1) # Excellon format self.excellon_format_label = FCLabel("%s:" % _("Excellon Format")) diff --git a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py index 1b904a31..2bd215de 100644 --- a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py @@ -31,8 +31,6 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): grid2 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid2) - grid2.setColumnStretch(0, 0) - grid2.setColumnStretch(1, 1) # ### Milling Holes ## ## self.mill_hole_label = FCLabel('%s' % _('Mill Holes')) diff --git a/appGUI/preferences/general/GeneralAPPSetGroupUI.py b/appGUI/preferences/general/GeneralAPPSetGroupUI.py index b96f768c..85a69fc8 100644 --- a/appGUI/preferences/general/GeneralAPPSetGroupUI.py +++ b/appGUI/preferences/general/GeneralAPPSetGroupUI.py @@ -36,8 +36,6 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): # Create a grid layout for the Application general settings grid0 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) # GRID Settings self.grid_label = FCLabel('%s' % _('Grid Settings')) diff --git a/appGUI/preferences/general/GeneralAppPrefGroupUI.py b/appGUI/preferences/general/GeneralAppPrefGroupUI.py index ca2a1a0c..a9aa0ade 100644 --- a/appGUI/preferences/general/GeneralAppPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralAppPrefGroupUI.py @@ -27,8 +27,6 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): # Create a form layout for the Application general settings grid0 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) # Units for FlatCAM self.unitslabel = FCLabel('%s:' % _('Units')) diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index 4c9faaea..16671bac 100644 --- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -25,8 +25,6 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): # Create a grid layout for the Application general settings grid0 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) # Theme selection self.theme_label = FCLabel('%s:' % _('Theme')) diff --git a/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py index 38bb2d31..5823e255 100644 --- a/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py @@ -34,8 +34,6 @@ class GeometryAdvOptPrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.geo_label) grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) self.layout.addLayout(grid1) # Size of trace segment on X axis diff --git a/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py b/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py index 0ea0f52b..891d99f7 100644 --- a/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py @@ -29,8 +29,6 @@ class GeometryExpPrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.export_options_label) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # Excellon non-decimal format diff --git a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py index d9bb01c8..53a05a6d 100644 --- a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py @@ -46,8 +46,6 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): grid0 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) # Number of circle steps for circular aperture linear approximation self.circle_steps_label = FCLabel('%s:' % _("Circle Steps")) diff --git a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py index f9f9be46..8440e9ef 100644 --- a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py @@ -36,8 +36,6 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): grid1 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid1) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) # Cut Z cutzlabel = FCLabel('%s:' % _('Cut Z')) diff --git a/appGUI/preferences/gerber/GerberExpPrefGroupUI.py b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py index f4391f81..d5a357a7 100644 --- a/appGUI/preferences/gerber/GerberExpPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py @@ -30,8 +30,6 @@ class GerberExpPrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.export_options_label) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # Gerber Units diff --git a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py index f983b4d7..f02f7554 100644 --- a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py @@ -1,6 +1,7 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCLabel, FCCheckBox, FCGridLayout +from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCLabel, FCCheckBox, FCGridLayout, FCFrame, \ + FCComboBox2 from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -21,19 +22,22 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.decimals = decimals self.defaults = defaults - # ## Grid Layout - grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) - self.layout.addLayout(grid_lay) - grid_lay.setColumnStretch(0, 0) - grid_lay.setColumnStretch(1, 1) - - # ## Parameters - self.cflabel = FCLabel('%s' % _('Parameters')) - self.cflabel.setToolTip( + # ############################################################################################################# + # Parameters Frame + # ############################################################################################################# + self.param_label = FCLabel('%s' % _('Parameters')) + self.param_label.setToolTip( _("A tool to generate a Copper Thieving that can be added\n" "to a selected Gerber file.") ) - grid_lay.addWidget(self.cflabel, 0, 0, 1, 2) + self.layout.addWidget(self.param_label) + + par_frame = FCFrame() + self.layout.addWidget(par_frame) + + # ## Grid Layout + grid_par = FCGridLayout(v_spacing=5, h_spacing=3) + par_frame.setLayout(grid_par) # CIRCLE STEPS - to be used when buffering self.circle_steps_lbl = FCLabel('%s:' % _("Circle Steps")) @@ -44,8 +48,8 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.circlesteps_entry = FCSpinner() self.circlesteps_entry.set_range(1, 10000) - grid_lay.addWidget(self.circle_steps_lbl, 2, 0) - grid_lay.addWidget(self.circlesteps_entry, 2, 1) + grid_par.addWidget(self.circle_steps_lbl, 2, 0) + grid_par.addWidget(self.circlesteps_entry, 2, 1) # CLEARANCE # self.clearance_label = FCLabel('%s:' % _("Clearance")) @@ -59,8 +63,8 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.clearance_entry.set_precision(self.decimals) self.clearance_entry.setSingleStep(0.1) - grid_lay.addWidget(self.clearance_label, 4, 0) - grid_lay.addWidget(self.clearance_entry, 4, 1) + grid_par.addWidget(self.clearance_label, 4, 0) + grid_par.addWidget(self.clearance_entry, 4, 1) # MARGIN # self.margin_label = FCLabel('%s:' % _("Margin")) @@ -72,8 +76,8 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.margin_entry.set_precision(self.decimals) self.margin_entry.setSingleStep(0.1) - grid_lay.addWidget(self.margin_label, 6, 0) - grid_lay.addWidget(self.margin_entry, 6, 1) + grid_par.addWidget(self.margin_label, 6, 0) + grid_par.addWidget(self.margin_entry, 6, 1) # Area # self.area_label = FCLabel('%s:' % _("Area")) @@ -85,23 +89,22 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.area_entry.set_precision(self.decimals) self.area_entry.setSingleStep(0.1) - grid_lay.addWidget(self.area_label, 8, 0) - grid_lay.addWidget(self.area_entry, 8, 1) + grid_par.addWidget(self.area_label, 8, 0) + grid_par.addWidget(self.area_entry, 8, 1) # Reference # - self.reference_radio = RadioSet([ - {'label': _('Itself'), 'value': 'itself'}, - {"label": _("Area Selection"), "value": "area"}, - {'label': _("Reference Object"), 'value': 'box'} - ], orientation='vertical', stretch=False) + # Reference # self.reference_label = FCLabel(_("Reference:")) self.reference_label.setToolTip( _("- 'Itself' - the copper thieving extent is based on the object extent.\n" "- 'Area Selection' - left mouse click to start selection of the area to be filled.\n" "- 'Reference Object' - will do copper thieving within the area specified by another object.") ) - grid_lay.addWidget(self.reference_label, 10, 0) - grid_lay.addWidget(self.reference_radio, 10, 1) + self.reference_combo = FCComboBox2() + self.reference_combo.addItems([_('Itself'), _("Area Selection"), _("Reference Object")]) + + grid_par.addWidget(self.reference_label, 10, 0) + grid_par.addWidget(self.reference_combo, 10, 1) # Bounding Box Type # self.bbox_type_radio = RadioSet([ @@ -113,33 +116,41 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): _("- 'Rectangular' - the bounding box will be of rectangular shape.\n" "- 'Minimal' - the bounding box will be the convex hull shape.") ) - grid_lay.addWidget(self.bbox_type_label, 12, 0) - grid_lay.addWidget(self.bbox_type_radio, 12, 1) + grid_par.addWidget(self.bbox_type_label, 12, 0) + grid_par.addWidget(self.bbox_type_radio, 12, 1) separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid_lay.addWidget(separator_line, 14, 0, 1, 2) + grid_par.addWidget(separator_line, 14, 0, 1, 2) # Fill Type - self.fill_type_radio = RadioSet([ - {'label': _('Solid'), 'value': 'solid'}, - {"label": _("Dots Grid"), "value": "dot"}, - {"label": _("Squares Grid"), "value": "square"}, - {"label": _("Lines Grid"), "value": "line"} - ], orientation='vertical', stretch=False) - self.fill_type_label = FCLabel(_("Fill Type:")) + self.fill_type_label = FCLabel('%s:' % _("Fill")) self.fill_type_label.setToolTip( _("- 'Solid' - copper thieving will be a solid polygon.\n" "- 'Dots Grid' - the empty area will be filled with a pattern of dots.\n" "- 'Squares Grid' - the empty area will be filled with a pattern of squares.\n" "- 'Lines Grid' - the empty area will be filled with a pattern of lines.") ) - grid_lay.addWidget(self.fill_type_label, 16, 0) - grid_lay.addWidget(self.fill_type_radio, 16, 1) + self.fill_type_combo = FCComboBox2() + self.fill_type_combo.addItems([_('Solid'), _("Dots Grid"), _("Squares Grid"), _("Lines Grid")]) + + grid_par.addWidget(self.fill_type_label, 16, 0) + grid_par.addWidget(self.fill_type_combo, 16, 1) + + # ############################################################################################################# + # DOTS Grid Parameters Frame + # ############################################################################################################# self.dots_label = FCLabel('%s:' % _("Dots Grid Parameters")) - grid_lay.addWidget(self.dots_label, 18, 0, 1, 2) + self.layout.addWidget(self.dots_label) + + dots_frame = FCFrame() + self.layout.addWidget(dots_frame) + + # ## Grid Layout + grid_dots = FCGridLayout(v_spacing=5, h_spacing=3) + dots_frame.setLayout(grid_dots) # Dot diameter # self.dotdia_label = FCLabel('%s:' % _("Dia")) @@ -151,8 +162,8 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.dot_dia_entry.set_precision(self.decimals) self.dot_dia_entry.setSingleStep(0.1) - grid_lay.addWidget(self.dotdia_label, 20, 0) - grid_lay.addWidget(self.dot_dia_entry, 20, 1) + grid_dots.addWidget(self.dotdia_label, 0, 0) + grid_dots.addWidget(self.dot_dia_entry, 0, 1) # Dot spacing # self.dotspacing_label = FCLabel('%s:' % _("Spacing")) @@ -164,11 +175,21 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.dot_spacing_entry.set_precision(self.decimals) self.dot_spacing_entry.setSingleStep(0.1) - grid_lay.addWidget(self.dotspacing_label, 22, 0) - grid_lay.addWidget(self.dot_spacing_entry, 22, 1) + grid_dots.addWidget(self.dotspacing_label, 2, 0) + grid_dots.addWidget(self.dot_spacing_entry, 2, 1) + # ############################################################################################################# + # Squares Grid Parameters Frame + # ############################################################################################################# self.squares_label = FCLabel('%s:' % _("Squares Grid Parameters")) - grid_lay.addWidget(self.squares_label, 24, 0, 1, 2) + self.layout.addWidget(self.squares_label) + + square_frame = FCFrame() + self.layout.addWidget(square_frame) + + # ## Grid Layout + grid_square = FCGridLayout(v_spacing=5, h_spacing=3) + square_frame.setLayout(grid_square) # Square Size # self.square_size_label = FCLabel('%s:' % _("Size")) @@ -180,8 +201,8 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.square_size_entry.set_precision(self.decimals) self.square_size_entry.setSingleStep(0.1) - grid_lay.addWidget(self.square_size_label, 26, 0) - grid_lay.addWidget(self.square_size_entry, 26, 1) + grid_square.addWidget(self.square_size_label, 0, 0) + grid_square.addWidget(self.square_size_entry, 0, 1) # Squares spacing # self.squares_spacing_label = FCLabel('%s:' % _("Spacing")) @@ -193,13 +214,23 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.squares_spacing_entry.set_precision(self.decimals) self.squares_spacing_entry.setSingleStep(0.1) - grid_lay.addWidget(self.squares_spacing_label, 28, 0) - grid_lay.addWidget(self.squares_spacing_entry, 28, 1) + grid_square.addWidget(self.squares_spacing_label, 2, 0) + grid_square.addWidget(self.squares_spacing_entry, 2, 1) + # ############################################################################################################# + # Lines Grid Parameters Frame + # ############################################################################################################# self.lines_label = FCLabel('%s:' % _("Lines Grid Parameters")) - grid_lay.addWidget(self.lines_label, 30, 0, 1, 2) + self.layout.addWidget(self.lines_label) - # Square Size # + line_frame = FCFrame() + self.layout.addWidget(line_frame) + + # ## Grid Layout + grid_line = FCGridLayout(v_spacing=5, h_spacing=3) + line_frame.setLayout(grid_line) + + # Line Size # self.line_size_label = FCLabel('%s:' % _("Size")) self.line_size_label.setToolTip( _("Line thickness size in Lines Grid.") @@ -209,8 +240,8 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.line_size_entry.set_precision(self.decimals) self.line_size_entry.setSingleStep(0.1) - grid_lay.addWidget(self.line_size_label, 32, 0) - grid_lay.addWidget(self.line_size_entry, 32, 1) + grid_line.addWidget(self.line_size_label, 0, 0) + grid_line.addWidget(self.line_size_entry, 0, 1) # Lines spacing # self.lines_spacing_label = FCLabel('%s:' % _("Spacing")) @@ -222,15 +253,25 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.lines_spacing_entry.set_precision(self.decimals) self.lines_spacing_entry.setSingleStep(0.1) - grid_lay.addWidget(self.lines_spacing_label, 34, 0) - grid_lay.addWidget(self.lines_spacing_entry, 34, 1) + grid_line.addWidget(self.lines_spacing_label, 2, 0) + grid_line.addWidget(self.lines_spacing_entry, 2, 1) + # ############################################################################################################# + # Robber Bar Parameters Frame + # ############################################################################################################# self.robber_bar_label = FCLabel('%s' % _('Robber Bar Parameters')) self.robber_bar_label.setToolTip( _("Parameters used for the robber bar.\n" "Robber bar = copper border to help in pattern hole plating.") ) - grid_lay.addWidget(self.robber_bar_label, 36, 0, 1, 2) + self.layout.addWidget(self.robber_bar_label) + + rob_frame = FCFrame() + self.layout.addWidget(rob_frame) + + # ## Grid Layout + grid_robber = FCGridLayout(v_spacing=5, h_spacing=3) + rob_frame.setLayout(grid_robber) # ROBBER BAR MARGIN # self.rb_margin_label = FCLabel('%s:' % _("Margin")) @@ -242,8 +283,8 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.rb_margin_entry.set_precision(self.decimals) self.rb_margin_entry.setSingleStep(0.1) - grid_lay.addWidget(self.rb_margin_label, 38, 0) - grid_lay.addWidget(self.rb_margin_entry, 38, 1) + grid_robber.addWidget(self.rb_margin_label, 0, 0) + grid_robber.addWidget(self.rb_margin_entry, 0, 1) # THICKNESS # self.rb_thickness_label = FCLabel('%s:' % _("Thickness")) @@ -255,22 +296,31 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.rb_thickness_entry.set_precision(self.decimals) self.rb_thickness_entry.setSingleStep(0.1) - grid_lay.addWidget(self.rb_thickness_label, 40, 0) - grid_lay.addWidget(self.rb_thickness_entry, 40, 1) + grid_robber.addWidget(self.rb_thickness_label, 2, 0) + grid_robber.addWidget(self.rb_thickness_entry, 2, 1) - # Pattern Plating Mask Title + # ############################################################################################################# + # RPattern Plating Mask Parameters Frame + # ############################################################################################################# self.patern_mask_label = FCLabel('%s' % _('Pattern Plating Mask')) self.patern_mask_label.setToolTip( _("Generate a mask for pattern plating.") ) - grid_lay.addWidget(self.patern_mask_label, 42, 0, 1, 2) + self.layout.addWidget(self.patern_mask_label) + + ppm_frame = FCFrame() + self.layout.addWidget(ppm_frame) + + # ## Grid Layout + grid_ppm = FCGridLayout(v_spacing=5, h_spacing=3) + ppm_frame.setLayout(grid_ppm) # Use Only Pads self.only_pads_cb = FCCheckBox(_("Only Pads")) self.only_pads_cb.setToolTip( _("Select only pads in case the selected object is a copper Gerber.") ) - grid_lay.addWidget(self.only_pads_cb, 43, 0, 1, 2) + grid_ppm.addWidget(self.only_pads_cb, 0, 0, 1, 2) # Openings CLEARANCE # self.clearance_ppm_label = FCLabel('%s:' % _("Clearance")) @@ -283,21 +333,17 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.clearance_ppm_entry.set_precision(self.decimals) self.clearance_ppm_entry.setSingleStep(0.1) - grid_lay.addWidget(self.clearance_ppm_label, 44, 0) - grid_lay.addWidget(self.clearance_ppm_entry, 44, 1) + grid_ppm.addWidget(self.clearance_ppm_label, 2, 0) + grid_ppm.addWidget(self.clearance_ppm_entry, 2, 1) # Include geometry self.ppm_choice_label = FCLabel('%s:' % _("Add")) self.ppm_choice_label.setToolTip( _("Choose which additional geometry to include, if available.") ) - self.ppm_choice_radio = RadioSet([ - {"label": _("Both"), "value": "b"}, - {'label': _('Thieving'), 'value': 't'}, - {"label": _("Robber bar"), "value": "r"}, - {"label": _("None"), "value": "n"} - ], orientation='vertical', stretch=False) - grid_lay.addWidget(self.ppm_choice_label, 46, 0) - grid_lay.addWidget(self.ppm_choice_radio, 46, 1) + self.ppm_choice_combo = FCComboBox2() + self.ppm_choice_combo.addItems([_("Both"), _('Thieving'), _("Robber bar"), _("None")]) + grid_ppm.addWidget(self.ppm_choice_label, 4, 0) + grid_ppm.addWidget(self.ppm_choice_combo, 4, 1) self.layout.addStretch() diff --git a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py index f24245c0..8bebd33a 100644 --- a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py @@ -24,8 +24,6 @@ class Tools2CalPrefGroupUI(OptionsGroupUI): # ## Grid Layout grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid_lay) - grid_lay.setColumnStretch(0, 0) - grid_lay.setColumnStretch(1, 1) self.param_label = FCLabel('%s:' % _('Parameters')) self.param_label.setToolTip( diff --git a/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py b/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py index e4f80c9a..5dcd9967 100644 --- a/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py @@ -24,8 +24,6 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI): # ## Grid Layout grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid_lay) - grid_lay.setColumnStretch(0, 0) - grid_lay.setColumnStretch(1, 1) self.param_label = FCLabel('%s:' % _('Parameters')) self.param_label.setToolTip( diff --git a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py index ab183e1f..7e2d314d 100644 --- a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py @@ -35,8 +35,6 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): # ## Grid Layout grid_par = FCGridLayout(v_spacing=5, h_spacing=3) - grid_par.setColumnStretch(0, 0) - grid_par.setColumnStretch(1, 1) par_frame.setLayout(grid_par) # DIAMETER # @@ -128,8 +126,6 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): # Grid Layout grid_sel = FCGridLayout(v_spacing=5, h_spacing=3) - grid_sel.setColumnStretch(0, 0) - grid_sel.setColumnStretch(1, 1) s_frame.setLayout(grid_sel) # Mode # diff --git a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py index c34bc172..f5e0cdd7 100644 --- a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py @@ -31,8 +31,6 @@ class Tools2InvertPrefGroupUI(OptionsGroupUI): # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # Margin diff --git a/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py index 3a187c7c..1b993910 100644 --- a/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py @@ -31,8 +31,6 @@ class Tools2OptimalPrefGroupUI(OptionsGroupUI): grid0 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.precision_sp = FCSpinner() self.precision_sp.set_range(2, 10) diff --git a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py index 02bc872e..ee9a7d7d 100644 --- a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py @@ -24,8 +24,6 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): # ## Grid Layout grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid_lay) - grid_lay.setColumnStretch(0, 0) - grid_lay.setColumnStretch(1, 1) self.param_label = FCLabel('%s:' % _('Parameters')) self.param_label.setToolTip( diff --git a/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py index eeb4ab6d..75d33562 100644 --- a/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py @@ -32,8 +32,6 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): # ## Grid Layout grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid_lay) - grid_lay.setColumnStretch(0, 0) - grid_lay.setColumnStretch(1, 1) # VERSION # self.version_label = FCLabel('%s:' % _("Version")) diff --git a/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py index 0dce9d32..e3702e04 100644 --- a/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py @@ -30,8 +30,6 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): # Form Layout self.grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - self.grid0.setColumnStretch(0, 0) - self.grid0.setColumnStretch(1, 1) self.layout.addLayout(self.grid0) # Trace size diff --git a/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py b/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py index 18ad3a31..cfc6341d 100644 --- a/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py @@ -31,8 +31,6 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.vshape_tool_label) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # ## Tip Diameter diff --git a/appGUI/preferences/tools/ToolsCornersPrefGroupUI.py b/appGUI/preferences/tools/ToolsCornersPrefGroupUI.py index ad04c690..8230cb03 100644 --- a/appGUI/preferences/tools/ToolsCornersPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsCornersPrefGroupUI.py @@ -22,8 +22,6 @@ class ToolsCornersPrefGroupUI(OptionsGroupUI): self.defaults = defaults grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) self.param_label = FCLabel('%s:' % _('Parameters')) diff --git a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py index d92881bd..c8efce21 100644 --- a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py @@ -36,8 +36,6 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): self.layout.addWidget(adj_frame) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) adj_frame.setLayout(grid0) # Scale Geometry @@ -58,8 +56,6 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): grid0.addWidget(scale_frame, 4, 0, 1, 2) grid_scale = FCGridLayout(v_spacing=5, h_spacing=3) - grid_scale.setColumnStretch(0, 0) - grid_scale.setColumnStretch(1, 1) scale_frame.setLayout(grid_scale) # Scale X factor @@ -113,8 +109,6 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): grid0.addWidget(skew_frame, 8, 0, 1, 2) grid_skew = FCGridLayout(v_spacing=5, h_spacing=3) - grid_skew.setColumnStretch(0, 0) - grid_skew.setColumnStretch(1, 1) skew_frame.setLayout(grid_skew) self.film_skewx_label = FCLabel('%s:' % _("X angle")) @@ -188,8 +182,6 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): self.layout.addWidget(par_frame) grid_par = FCGridLayout() - grid_par.setColumnStretch(0, 0) - grid_par.setColumnStretch(1, 1) par_frame.setLayout(grid_par) self.film_type_radio = RadioSet([{'label': 'Pos', 'value': 'pos'}, diff --git a/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py b/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py index 1d94aa79..7cc904dd 100644 --- a/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py @@ -30,8 +30,6 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # Probe points mode diff --git a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py index ad9fcc8d..18747147 100644 --- a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py @@ -33,8 +33,6 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.paint_label) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # Tool dia diff --git a/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py index b4e975dd..616a0e5a 100644 --- a/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py @@ -32,8 +32,6 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): grid0 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) # ## Spacing Columns self.pspacing_columns = FCDoubleSpinner() diff --git a/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py index 806fe845..fefe0ec7 100644 --- a/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py @@ -31,8 +31,6 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): grid0 = FCGridLayout(v_spacing=5, h_spacing=3) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) # Reference Type ref_label = FCLabel('%s:' % _("Reference")) diff --git a/appPlugins/ToolAlignObjects.py b/appPlugins/ToolAlignObjects.py index cb80cc97..b4ce889d 100644 --- a/appPlugins/ToolAlignObjects.py +++ b/appPlugins/ToolAlignObjects.py @@ -441,8 +441,6 @@ class AlignUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) m_frame.setLayout(grid0) # Type of object to be aligned @@ -482,8 +480,6 @@ class AlignUI: # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) d_frame.setLayout(grid1) # Type of object to be aligned to = aligner @@ -517,8 +513,6 @@ class AlignUI: # Grid Layout grid2 = FCGridLayout(v_spacing=5, h_spacing=3) - grid2.setColumnStretch(0, 0) - grid2.setColumnStretch(1, 1) par_frame.setLayout(grid2) # Alignment Type diff --git a/appPlugins/ToolCalculators.py b/appPlugins/ToolCalculators.py index 8b08d63a..f5c372a8 100644 --- a/appPlugins/ToolCalculators.py +++ b/appPlugins/ToolCalculators.py @@ -600,8 +600,6 @@ class CalcUI: self.layout.addWidget(v_frame) grid_vshape = FCGridLayout(v_spacing=5, h_spacing=3) - grid_vshape.setColumnStretch(0, 0) - grid_vshape.setColumnStretch(1, 1) v_frame.setLayout(grid_vshape) # self.v_shape_spacer_label = FCLabel(" ") @@ -680,9 +678,6 @@ class CalcUI: self.layout.addWidget(ep_frame) grid_electro = FCGridLayout(v_spacing=5, h_spacing=3) - grid_electro.setColumnStretch(0, 0) - grid_electro.setColumnStretch(1, 1) - ep_frame.setLayout(grid_electro) # grid_electro.addWidget(FCLabel(""), 0, 0, 1, 2) @@ -862,9 +857,6 @@ class CalcUI: self.layout.addWidget(tin_frame) grid_tin = FCGridLayout(v_spacing=5, h_spacing=3) - grid_tin.setColumnStretch(0, 0) - grid_tin.setColumnStretch(1, 1) - tin_frame.setLayout(grid_tin) # Solution diff --git a/appPlugins/ToolCalibration.py b/appPlugins/ToolCalibration.py index 94a98c5c..baef3d1c 100644 --- a/appPlugins/ToolCalibration.py +++ b/appPlugins/ToolCalibration.py @@ -781,11 +781,8 @@ class CalibrationUI: self.layout.addWidget(title_label) # ## Grid Layout - grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) + grid_lay = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) self.layout.addLayout(grid_lay) - grid_lay.setColumnStretch(0, 0) - grid_lay.setColumnStretch(1, 1) - grid_lay.setColumnStretch(2, 0) self.gcode_title_label = FCLabel('%s:' % _('Parameters')) self.gcode_title_label.setToolTip( diff --git a/appPlugins/ToolCopperThieving.py b/appPlugins/ToolCopperThieving.py index 0775ad3b..acb38a03 100644 --- a/appPlugins/ToolCopperThieving.py +++ b/appPlugins/ToolCopperThieving.py @@ -10,7 +10,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui from camlib import grace from appTool import AppTool from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCEntry, FCComboBox, FCLabel, FCCheckBox, \ - VerticalScrollArea, FCGridLayout, FCFrame + VerticalScrollArea, FCGridLayout, FCFrame, FCComboBox2 from appCommon.Common import LoudDict import shapely.geometry.base as base @@ -150,8 +150,8 @@ class ToolCopperThieving(AppTool): def connect_signals_at_init(self): # SIGNALS self.ui.ref_combo_type.currentIndexChanged.connect(self.on_ref_combo_type_change) - self.ui.reference_radio.group_toggle_fn = self.on_toggle_reference - self.ui.fill_type_radio.activated_custom.connect(self.on_thieving_type) + self.ui.reference_combo.currentIndexChanged.connect(self.on_toggle_reference) + self.ui.fill_type_combo.currentIndexChanged.connect(self.on_thieving_type) self.ui.fill_button.clicked.connect(self.on_add_copper_thieving_click) self.ui.rb_button.clicked.connect(self.on_add_robber_bar_click) @@ -171,9 +171,9 @@ class ToolCopperThieving(AppTool): self.ui.clearance_entry.set_value(float(self.app.defaults["tools_copper_thieving_clearance"])) self.ui.margin_entry.set_value(float(self.app.defaults["tools_copper_thieving_margin"])) - self.ui.reference_radio.set_value(self.app.defaults["tools_copper_thieving_reference"]) + self.ui.reference_combo.set_value(self.app.defaults["tools_copper_thieving_reference"]) self.ui.bbox_type_radio.set_value(self.app.defaults["tools_copper_thieving_box_type"]) - self.ui.fill_type_radio.set_value(self.app.defaults["tools_copper_thieving_fill_type"]) + self.ui.fill_type_combo.set_value(self.app.defaults["tools_copper_thieving_fill_type"]) self.ui.area_entry.set_value(self.app.defaults["tools_copper_thieving_area"]) self.ui.dot_dia_entry.set_value(self.app.defaults["tools_copper_thieving_dots_dia"]) @@ -187,7 +187,7 @@ class ToolCopperThieving(AppTool): self.ui.rb_thickness_entry.set_value(self.app.defaults["tools_copper_thieving_rb_thickness"]) self.ui.only_pads_cb.set_value(self.app.defaults["tools_copper_thieving_only_apds"]) self.ui.clearance_ppm_entry.set_value(self.app.defaults["tools_copper_thieving_mask_clearance"]) - self.ui.ppm_choice_radio.set_value(self.app.defaults["tools_copper_thieving_geo_choice"]) + self.ui.ppm_choice_combo.set_value(self.app.defaults["tools_copper_thieving_geo_choice"]) # INIT SECTION self.handlers_connected = False @@ -210,48 +210,49 @@ class ToolCopperThieving(AppTool): }[self.ui.ref_combo_type.get_value()] def on_toggle_reference(self): - if self.ui.reference_radio.get_value() == "itself" or self.ui.reference_radio.get_value() == "area": + ref_val = self.ui.reference_combo.get_value() + # if in ["itself", "area"] + if ref_val == 0 or ref_val == 1: self.ui.ref_combo.hide() - self.ui.ref_combo_label.hide() self.ui.ref_combo_type.hide() self.ui.ref_combo_type_label.hide() else: self.ui.ref_combo.show() - self.ui.ref_combo_label.show() self.ui.ref_combo_type.show() self.ui.ref_combo_type_label.show() - if self.ui.reference_radio.get_value() == "itself": + if ref_val == 0: # "itself" self.ui.bbox_type_label.show() self.ui.bbox_type_radio.show() else: - if self.ui.fill_type_radio.get_value() == 'line': - self.ui.reference_radio.set_value('itself') + if self.ui.fill_type_combo.get_value() == 3: # 'line' + self.ui.reference_combo.set_value(0) # 'itself' self.app.inform.emit('[WARNING_NOTCL] %s' % _("Lines Grid works only for 'itself' reference ...")) return self.ui.bbox_type_label.hide() self.ui.bbox_type_radio.hide() - def on_thieving_type(self, choice): - if choice == 'solid': + def on_thieving_type(self, new_index): + if new_index == 0: # "solid" self.ui.dots_frame.hide() self.ui.squares_frame.hide() self.ui.lines_frame.hide() self.app.inform.emit(_("Solid fill selected.")) - elif choice == 'dot': + elif new_index == 1: # 'dot' self.ui.dots_frame.show() self.ui.squares_frame.hide() self.ui.lines_frame.hide() self.app.inform.emit(_("Dots grid fill selected.")) - elif choice == 'square': + elif new_index == 2: # 'square' self.ui.dots_frame.hide() self.ui.squares_frame.show() self.ui.lines_frame.hide() self.app.inform.emit(_("Squares grid fill selected.")) - else: - if self.ui.reference_radio.get_value() != 'itself': - self.ui.reference_radio.set_value('itself') + else: # 'lines' + ref_val = self.ui.reference_combo.get_value() + if ref_val != 0: # 'itself' + self.ui.reference_combo.set_value(0) # 'itself' self.app.inform.emit('[WARNING_NOTCL] %s' % _("Lines Grid works only for 'itself' reference ...")) self.ui.dots_frame.hide() @@ -358,7 +359,7 @@ class ToolCopperThieving(AppTool): self.clearance_val = self.ui.clearance_entry.get_value() self.margin_val = self.ui.margin_entry.get_value() - reference_method = self.ui.reference_radio.get_value() + reference_method = self.ui.reference_combo.get_value() # get the Gerber object on which the Copper thieving will be inserted selection_index = self.ui.grb_object_combo.currentIndex() @@ -371,7 +372,7 @@ class ToolCopperThieving(AppTool): self.app.inform.emit('[WARNING_NOTCL] %s' % _("There is no Gerber object loaded ...")) return - if reference_method == 'itself': + if reference_method == 0: # 'itself' bound_obj_name = self.ui.grb_object_combo.currentText() # Get reference object. @@ -387,11 +388,11 @@ class ToolCopperThieving(AppTool): margin=self.margin_val ) - elif reference_method == 'area': + elif reference_method == 1: # 'area' self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click the start point of the area.")) self.connect_event_handlers() - elif reference_method == 'box': + elif reference_method == 2: # 'box' bound_obj_name = self.ui.ref_combo.currentText() # Get reference object. @@ -555,14 +556,14 @@ class ToolCopperThieving(AppTool): log.debug("Copper Thieving Tool started. Reading parameters.") self.app.inform.emit(_("Copper Thieving Tool started. Reading parameters.")) - ref_selected = self.ui.reference_radio.get_value() + ref_selected = self.ui.reference_combo.get_value() if c_val is None: c_val = float(self.app.defaults["tools_copper_thieving_clearance"]) if margin is None: margin = float(self.app.defaults["tools_copper_thieving_margin"]) min_area = self.ui.area_entry.get_value() - fill_type = self.ui.fill_type_radio.get_value() + fill_type = self.ui.fill_type_combo.get_value() dot_dia = self.ui.dot_dia_entry.get_value() dot_spacing = self.ui.dot_spacing_entry.get_value() square_size = self.ui.square_size_entry.get_value() @@ -628,7 +629,7 @@ class ToolCopperThieving(AppTool): tool_obj.app.inform.emit(_("Copper Thieving Tool. Preparing areas to fill with copper.")) try: - if ref_obj is None or ref_obj == 'itself': + if ref_obj is None or ref_selected == 0: # 'itself' working_obj = thieving_obj else: working_obj = ref_obj @@ -641,7 +642,7 @@ class ToolCopperThieving(AppTool): # ######################################################################################################### # generate the bounding box geometry # ######################################################################################################### - if ref_selected == 'itself': + if ref_selected == 0: # 'itself' geo_n = deepcopy(working_obj.solid_geometry) try: @@ -677,7 +678,7 @@ class ToolCopperThieving(AppTool): log.error("ToolCopperFIll.copper_thieving() 'itself' --> %s" % str(e)) tool_obj.app.inform.emit('[ERROR_NOTCL] %s' % _("No object available.")) return 'fail' - elif ref_selected == 'area': + elif ref_selected == 1: # 'area' geo_buff_list = [] try: for poly in working_obj: @@ -755,11 +756,11 @@ class ToolCopperThieving(AppTool): # ######################################################################################################### tool_obj.app.proc_container.update_view_text(' %s' % _("Create geometry")) - if fill_type == 'dot' or fill_type == 'square': + if fill_type == 1 or fill_type == 2: # 'dot' or 'square' # build the MultiPolygon of dots/squares that will fill the entire bounding box thieving_list = [] - if fill_type == 'dot': + if fill_type == 1: # 'dot' radius = dot_dia / 2.0 new_x = x0 + radius new_y = y0 + radius @@ -770,7 +771,7 @@ class ToolCopperThieving(AppTool): new_y += dot_dia + dot_spacing new_x += dot_dia + dot_spacing new_y = y0 + radius - else: + else: # 'square' h_size = square_size / 2.0 new_x = x0 + h_size new_y = y0 + h_size @@ -802,7 +803,7 @@ class ToolCopperThieving(AppTool): tool_obj.thief_solid_geometry = thieving_geo - if fill_type == 'line': + if fill_type == 3: # 'line' half_thick_line = line_size / 2.0 # create a thick polygon-line that surrounds the copper features @@ -978,7 +979,7 @@ class ToolCopperThieving(AppTool): def on_new_pattern_plating_object(self): ppm_clearance = self.ui.clearance_ppm_entry.get_value() - geo_choice = self.ui.ppm_choice_radio.get_value() + geo_choice = self.ui.ppm_choice_combo.get_value() rb_thickness = self.ui.rb_thickness_entry.get_value() only_pads = self.ui.only_pads_cb.get_value() @@ -1051,7 +1052,7 @@ class ToolCopperThieving(AppTool): new_follow_geo = deepcopy(self.sm_object.follow_geometry) # if we have copper thieving geometry, add it - if thieving_solid_geo and geo_choice in ['b', 't']: + if thieving_solid_geo and geo_choice in [0, 1]: # ['b', 't'] # add to the total the thieving geometry area, if chosen for geo in thieving_solid_geo: plated_area += geo.area @@ -1089,7 +1090,7 @@ class ToolCopperThieving(AppTool): new_apertures[0]['geometry'].append(deepcopy(geo_elem)) # if we have robber bar geometry, add it - if robber_solid_geo and geo_choice in ['b', 'r']: + if robber_solid_geo and geo_choice in [0, 2]: # 'b', 'r' # add to the total the robber bar geometry are, if chose plated_area += robber_solid_geo.area @@ -1304,8 +1305,6 @@ class ThievingUI: # ## Grid Layout i_grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) - i_grid_lay.setColumnStretch(0, 0) - i_grid_lay.setColumnStretch(1, 1) self.tools_box.addLayout(i_grid_lay) self.grb_object_combo = FCComboBox() @@ -1329,8 +1328,6 @@ class ThievingUI: # ## Grid Layout grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) - grid_lay.setColumnStretch(0, 0) - grid_lay.setColumnStretch(1, 1) tp_frame.setLayout(grid_lay) # CLEARANCE # @@ -1385,21 +1382,19 @@ class ThievingUI: grid_lay.addLayout(area_hlay, 6, 1) # Reference # - self.reference_radio = RadioSet([ - {'label': _('Itself'), 'value': 'itself'}, - {"label": _("Area Selection"), "value": "area"}, - {'label': _("Reference Object"), 'value': 'box'} - ], orientation='vertical', stretch=False) self.reference_label = FCLabel(_("Reference:")) self.reference_label.setToolTip( _("- 'Itself' - the copper thieving extent is based on the object extent.\n" "- 'Area Selection' - left mouse click to start selection of the area to be filled.\n" "- 'Reference Object' - will do copper thieving within the area specified by another object.") ) - grid_lay.addWidget(self.reference_label, 8, 0) - grid_lay.addWidget(self.reference_radio, 8, 1) + self.reference_combo = FCComboBox2() + self.reference_combo.addItems([_('Itself'), _("Area Selection"), _("Reference Object")]) - self.ref_combo_type_label = FCLabel('%s:' % _("Ref. Type")) + grid_lay.addWidget(self.reference_label, 8, 0) + grid_lay.addWidget(self.reference_combo, 8, 1) + + self.ref_combo_type_label = FCLabel('%s:' % _("Type")) self.ref_combo_type_label.setToolTip( _("The type of FlatCAM object to be used as copper thieving reference.\n" "It can be Gerber, Excellon or Geometry.") @@ -1410,10 +1405,7 @@ class ThievingUI: grid_lay.addWidget(self.ref_combo_type_label, 10, 0) grid_lay.addWidget(self.ref_combo_type, 10, 1) - self.ref_combo_label = FCLabel('%s:' % _("Ref. Object")) - self.ref_combo_label.setToolTip( - _("The Application object to be used as non copper clearing reference.") - ) + # Object Reference self.ref_combo = FCComboBox() self.ref_combo.setModel(self.app.collection) self.ref_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex())) @@ -1422,11 +1414,9 @@ class ThievingUI: _("Gerber"): "Gerber", _("Excellon"): "Excellon", _("Geometry"): "Geometry" }[self.ref_combo_type.get_value()] - grid_lay.addWidget(self.ref_combo_label, 12, 0) - grid_lay.addWidget(self.ref_combo, 12, 1) + grid_lay.addWidget(self.ref_combo, 12, 0, 1, 2) self.ref_combo.hide() - self.ref_combo_label.hide() self.ref_combo_type.hide() self.ref_combo_type_label.hide() @@ -1452,21 +1442,18 @@ class ThievingUI: grid_lay.addWidget(separator_line, 16, 0, 1, 2) # Fill Type - self.fill_type_radio = RadioSet([ - {'label': _('Solid'), 'value': 'solid'}, - {"label": _("Dots Grid"), "value": "dot"}, - {"label": _("Squares Grid"), "value": "square"}, - {"label": _("Lines Grid"), "value": "line"} - ], orientation='vertical', stretch=False) - self.fill_type_label = FCLabel(_("Fill Type:")) + self.fill_type_label = FCLabel('%s:' % _("Fill")) self.fill_type_label.setToolTip( _("- 'Solid' - copper thieving will be a solid polygon.\n" "- 'Dots Grid' - the empty area will be filled with a pattern of dots.\n" "- 'Squares Grid' - the empty area will be filled with a pattern of squares.\n" "- 'Lines Grid' - the empty area will be filled with a pattern of lines.") ) + + self.fill_type_combo = FCComboBox2() + self.fill_type_combo.addItems([_('Solid'), _("Dots Grid"), _("Squares Grid"), _("Lines Grid")]) grid_lay.addWidget(self.fill_type_label, 18, 0) - grid_lay.addWidget(self.fill_type_radio, 18, 1) + grid_lay.addWidget(self.fill_type_combo, 18, 1) # ############################################################################################################# # DOTS FRAME @@ -1476,8 +1463,6 @@ class ThievingUI: grid_lay.addWidget(self.dots_frame, 20, 0, 1, 2) dots_grid = FCGridLayout(v_spacing=5, h_spacing=3) - dots_grid.setColumnStretch(0, 0) - dots_grid.setColumnStretch(1, 1) dots_grid.setContentsMargins(0, 0, 0, 0) self.dots_frame.setLayout(dots_grid) self.dots_frame.hide() @@ -1524,8 +1509,6 @@ class ThievingUI: grid_lay.addWidget(self.squares_frame, 22, 0, 1, 2) squares_grid = FCGridLayout(v_spacing=5, h_spacing=3) - squares_grid.setColumnStretch(0, 0) - squares_grid.setColumnStretch(1, 1) squares_grid.setContentsMargins(0, 0, 0, 0) self.squares_frame.setLayout(squares_grid) self.squares_frame.hide() @@ -1572,8 +1555,6 @@ class ThievingUI: grid_lay.addWidget(self.lines_frame, 24, 0, 1, 2) lines_grid = FCGridLayout(v_spacing=5, h_spacing=3) - lines_grid.setColumnStretch(0, 0) - lines_grid.setColumnStretch(1, 1) lines_grid.setContentsMargins(0, 0, 0, 0) self.lines_frame.setLayout(lines_grid) self.lines_frame.hide() @@ -1644,10 +1625,7 @@ class ThievingUI: self.tools_box.addWidget(rob_frame) # ## Grid Layout - grid_lay_1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid_lay_1.setColumnStretch(0, 0) - grid_lay_1.setColumnStretch(1, 1) - grid_lay_1.setColumnStretch(2, 0) + grid_lay_1 = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) rob_frame.setLayout(grid_lay_1) # separator_line_1 = QtWidgets.QFrame() @@ -1730,10 +1708,7 @@ class ThievingUI: self.tools_box.addWidget(pp_frame) # ## Grid Layout - grid_lay_2 = FCGridLayout(v_spacing=5, h_spacing=3) - grid_lay_2.setColumnStretch(0, 0) - grid_lay_2.setColumnStretch(1, 1) - grid_lay_2.setColumnStretch(2, 0) + grid_lay_2 = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) pp_frame.setLayout(grid_lay_2) # Only Pads @@ -1784,14 +1759,16 @@ class ThievingUI: self.ppm_choice_label.setToolTip( _("Choose which additional geometry to include, if available.") ) - self.ppm_choice_radio = RadioSet([ - {"label": _("Both"), "value": "b"}, - {'label': _('Thieving'), 'value': 't'}, - {"label": _("Robber bar"), "value": "r"}, - {"label": _("None"), "value": "n"} - ], orientation='vertical', stretch=False) + # self.ppm_choice_combo = RadioSet([ + # {"label": _("Both"), "value": "b"}, + # {'label': _('Thieving'), 'value': 't'}, + # {"label": _("Robber bar"), "value": "r"}, + # {"label": _("None"), "value": "n"} + # ], orientation='vertical', stretch=False) + self.ppm_choice_combo = FCComboBox2() + self.ppm_choice_combo.addItems([_("Both"),_('Thieving'), _("Robber bar"), _("None")]) grid_lay_2.addWidget(self.ppm_choice_label, 6, 0) - grid_lay_2.addWidget(self.ppm_choice_radio, 6, 1, 1, 2) + grid_lay_2.addWidget(self.ppm_choice_combo, 6, 1, 1, 2) # ############################################################################################################# # ## Pattern Plating Mask Button diff --git a/appPlugins/ToolCorners.py b/appPlugins/ToolCorners.py index 75693b1b..2102d1f3 100644 --- a/appPlugins/ToolCorners.py +++ b/appPlugins/ToolCorners.py @@ -753,8 +753,6 @@ class CornersUI: # ## Grid Layout grid_par = FCGridLayout(v_spacing=5, h_spacing=3) - grid_par.setColumnStretch(0, 0) - grid_par.setColumnStretch(1, 1) par_frame.setLayout(grid_par) # Type of Marker @@ -862,8 +860,6 @@ class CornersUI: # Grid Layout grid_sel = FCGridLayout(v_spacing=5, h_spacing=3) - grid_sel.setColumnStretch(0, 0) - grid_sel.setColumnStretch(1, 1) self.s_frame.setLayout(grid_sel) # Type of placement of markers @@ -909,8 +905,6 @@ class CornersUI: # Grid Layout grid_drill = FCGridLayout(v_spacing=5, h_spacing=3) - grid_drill.setColumnStretch(0, 0) - grid_drill.setColumnStretch(1, 1) self.drill_frame.setLayout(grid_drill) # Drill Tooldia # diff --git a/appPlugins/ToolCutOut.py b/appPlugins/ToolCutOut.py index 0bb17911..45bf6887 100644 --- a/appPlugins/ToolCutOut.py +++ b/appPlugins/ToolCutOut.py @@ -2333,8 +2333,6 @@ class CutoutUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) obj_frame.setLayout(grid0) # Object kind @@ -2388,8 +2386,6 @@ class CutoutUI: # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) tool_frame.setLayout(grid1) # Tool Diameter @@ -2448,8 +2444,6 @@ class CutoutUI: # Grid Layout grid2 = FCGridLayout(v_spacing=5, h_spacing=3) - grid2.setColumnStretch(0, 0) - grid2.setColumnStretch(1, 1) tool_par_frame.setLayout(grid2) # Convex Shape @@ -2762,8 +2756,6 @@ class CutoutUI: # Grid Layout grid3 = FCGridLayout(v_spacing=5, h_spacing=3) - grid3.setColumnStretch(0, 0) - grid3.setColumnStretch(1, 1) self.drill_cut_frame.setLayout(grid3) # Drilling Geo Object Label diff --git a/appPlugins/ToolDblSided.py b/appPlugins/ToolDblSided.py index a8871027..3bf33749 100644 --- a/appPlugins/ToolDblSided.py +++ b/appPlugins/ToolDblSided.py @@ -733,8 +733,6 @@ class DsidedUI: self.tools_box.addWidget(self.bounds_frame) grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) self.bounds_frame.setLayout(grid1) # Xmin value @@ -833,8 +831,6 @@ class DsidedUI: self.tools_box.addWidget(mirror_frame) grid2 = FCGridLayout(v_spacing=5, h_spacing=3) - grid2.setColumnStretch(0, 0) - grid2.setColumnStretch(1, 1) mirror_frame.setLayout(grid2) # ## Axis @@ -926,8 +922,6 @@ class DsidedUI: # ## Grid Layout grid_lay3 = FCGridLayout(v_spacing=5, h_spacing=3) - grid_lay3.setColumnStretch(0, 0) - grid_lay3.setColumnStretch(1, 1) grid2.addLayout(grid_lay3, 14, 0, 1, 3) # Type of object used as BOX reference @@ -984,8 +978,6 @@ class DsidedUI: self.tools_box.addWidget(align_frame) grid4 = FCGridLayout(v_spacing=5, h_spacing=3) - grid4.setColumnStretch(0, 0) - grid4.setColumnStretch(1, 1) align_frame.setLayout(grid4) # ## Drill diameter for alignment holes diff --git a/appPlugins/ToolDistance.py b/appPlugins/ToolDistance.py index 77d0fc2a..4f41c447 100644 --- a/appPlugins/ToolDistance.py +++ b/appPlugins/ToolDistance.py @@ -580,8 +580,6 @@ class DistUI: # ## Form Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) self.units_label = FCLabel('%s:' % _("Units")) diff --git a/appPlugins/ToolDistanceMin.py b/appPlugins/ToolDistanceMin.py index 2bc8a2b1..390e296c 100644 --- a/appPlugins/ToolDistanceMin.py +++ b/appPlugins/ToolDistanceMin.py @@ -254,8 +254,6 @@ class DistMinUI: # ## Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # Units diff --git a/appPlugins/ToolDrilling.py b/appPlugins/ToolDrilling.py index bbbd57ae..035c8010 100644 --- a/appPlugins/ToolDrilling.py +++ b/appPlugins/ToolDrilling.py @@ -2302,8 +2302,6 @@ class DrillingUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) # ################################################ @@ -2333,9 +2331,7 @@ class DrillingUI: self.tools_box.addWidget(tt_frame) # Grid Layout - grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - # grid1.setColumnStretch(0, 0) - # grid1.setColumnStretch(1, 1) + grid1 = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 0]) tt_frame.setLayout(grid1) self.tools_table = FCTable(drag_drop=True) @@ -2416,8 +2412,6 @@ class DrillingUI: # Grid Layout grid2 = FCGridLayout(v_spacing=5, h_spacing=3) - grid2.setColumnStretch(0, 0) - grid2.setColumnStretch(1, 1) tp_frame.setLayout(grid2) # Cut Z @@ -2641,8 +2635,6 @@ class DrillingUI: self.exc_tools_box.addWidget(gp_frame) grid3 = FCGridLayout(v_spacing=5, h_spacing=3) - grid3.setColumnStretch(0, 0) - grid3.setColumnStretch(1, 1) gp_frame.setLayout(grid3) # Tool change @@ -2822,8 +2814,6 @@ class DrillingUI: self.exclusion_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) grid_a1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid_a1.setColumnStretch(0, 0) - grid_a1.setColumnStretch(1, 1) self.exclusion_box.addLayout(grid_a1) # Chose Strategy diff --git a/appPlugins/ToolEtchCompensation.py b/appPlugins/ToolEtchCompensation.py index 3d38f1e3..2a271a38 100644 --- a/appPlugins/ToolEtchCompensation.py +++ b/appPlugins/ToolEtchCompensation.py @@ -357,8 +357,6 @@ class EtchUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) util_frame.setLayout(grid0) # Oz to um conversion @@ -416,8 +414,6 @@ class EtchUI: self.tools_box.addWidget(self.gp_frame) grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) self.gp_frame.setLayout(grid1) # Thickness diff --git a/appPlugins/ToolExtract.py b/appPlugins/ToolExtract.py index 1fcec9df..99291d14 100644 --- a/appPlugins/ToolExtract.py +++ b/appPlugins/ToolExtract.py @@ -955,12 +955,9 @@ class ExtractUI: pads_frame.setLayout(grid_lay) pad_all_grid = FCGridLayout(v_spacing=5, h_spacing=3) - pad_all_grid.setColumnStretch(0, 0) - pad_all_grid.setColumnStretch(1, 1) grid_lay.addLayout(pad_all_grid, 5, 0, 1, 2) - pad_grid = FCGridLayout(v_spacing=5, h_spacing=3) - pad_grid.setColumnStretch(0, 0) + pad_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0]) pad_all_grid.addLayout(pad_grid, 0, 0) # All Aperture Selection @@ -1053,8 +1050,6 @@ class ExtractUI: # ## Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) ed_frame.setLayout(grid1) self.method_label = FCLabel('%s:' % _("Method")) @@ -1095,8 +1090,6 @@ class ExtractUI: # ## Grid Layout ring_grid = FCGridLayout(v_spacing=5, h_spacing=3) - ring_grid.setColumnStretch(0, 0) - ring_grid.setColumnStretch(1, 1) ring_grid.setContentsMargins(0, 0, 0, 0) self.ring_box.addLayout(ring_grid) @@ -1182,8 +1175,6 @@ class ExtractUI: grid1.addWidget(self.fix_frame, 10, 0, 1, 2) fixed_grid = FCGridLayout(v_spacing=5, h_spacing=3) - fixed_grid.setColumnStretch(0, 0) - fixed_grid.setColumnStretch(1, 1) fixed_grid.setContentsMargins(0, 0, 0, 0) self.fix_frame.setLayout(fixed_grid) @@ -1212,8 +1203,6 @@ class ExtractUI: grid1.addWidget(self.prop_frame, 12, 0, 1, 2) prop_grid = FCGridLayout(v_spacing=5, h_spacing=3) - prop_grid.setColumnStretch(0, 0) - prop_grid.setColumnStretch(1, 1) prop_grid.setContentsMargins(0, 0, 0, 0) self.prop_frame.setLayout(prop_grid) @@ -1265,8 +1254,6 @@ class ExtractUI: self.tools_box.addWidget(self.es_frame) es_grid = FCGridLayout(v_spacing=5, h_spacing=3) - es_grid.setColumnStretch(0, 0) - es_grid.setColumnStretch(1, 1) self.es_frame.setLayout(es_grid) # CLEARANCE @@ -1312,8 +1299,6 @@ class ExtractUI: self.tools_box.addWidget(self.ec_frame) ec_grid = FCGridLayout(v_spacing=5, h_spacing=3) - ec_grid.setColumnStretch(0, 0) - ec_grid.setColumnStretch(1, 1) self.ec_frame.setLayout(ec_grid) # Margin diff --git a/appPlugins/ToolFiducials.py b/appPlugins/ToolFiducials.py index 6e565eca..fa676537 100644 --- a/appPlugins/ToolFiducials.py +++ b/appPlugins/ToolFiducials.py @@ -938,8 +938,6 @@ class FidoUI: # ## Grid Layout grid_par = FCGridLayout(v_spacing=5, h_spacing=3) - grid_par.setColumnStretch(0, 0) - grid_par.setColumnStretch(1, 1) par_frame.setLayout(grid_par) # DIAMETER # @@ -1036,8 +1034,6 @@ class FidoUI: # Grid Layout grid_sel = FCGridLayout(v_spacing=5, h_spacing=3) - grid_sel.setColumnStretch(0, 0) - grid_sel.setColumnStretch(1, 1) self.s_frame.setLayout(grid_sel) # Mode # diff --git a/appPlugins/ToolFilm.py b/appPlugins/ToolFilm.py index 22e52e9f..30efeb9e 100644 --- a/appPlugins/ToolFilm.py +++ b/appPlugins/ToolFilm.py @@ -1197,8 +1197,6 @@ class FilmUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) obj_frame.setLayout(grid0) # Type of object for which to create the film @@ -1266,8 +1264,6 @@ class FilmUI: # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) self.adj_frame.setLayout(grid1) # Scale Geometry @@ -1433,8 +1429,6 @@ class FilmUI: # Grid Layout grid_par = FCGridLayout(v_spacing=5, h_spacing=3) - grid_par.setColumnStretch(0, 0) - grid_par.setColumnStretch(1, 1) par_frame.setLayout(grid_par) # Scale Stroke size @@ -1499,8 +1493,6 @@ class FilmUI: grid_par.addWidget(self.punch_frame, 8, 0, 1, 2) punch_grid = FCGridLayout(v_spacing=5, h_spacing=3) - punch_grid.setColumnStretch(0, 0) - punch_grid.setColumnStretch(1, 1) punch_grid.setContentsMargins(0, 0, 0, 0) self.punch_frame.setLayout(punch_grid) @@ -1558,8 +1550,6 @@ class FilmUI: # Grid Layout grid3 = FCGridLayout(v_spacing=5, h_spacing=3) - grid3.setColumnStretch(0, 0) - grid3.setColumnStretch(1, 1) exp_frame.setLayout(grid3) self.file_type_label = FCLabel('%s:' % _("Film Type")) diff --git a/appPlugins/ToolFollow.py b/appPlugins/ToolFollow.py index 9fb3879e..2e950d19 100644 --- a/appPlugins/ToolFollow.py +++ b/appPlugins/ToolFollow.py @@ -738,8 +738,6 @@ class FollowUI: self.tools_box.addWidget(self.gp_frame) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.gp_frame.setLayout(grid0) # Polygon selection diff --git a/appPlugins/ToolImage.py b/appPlugins/ToolImage.py index a81e037b..cff79b01 100644 --- a/appPlugins/ToolImage.py +++ b/appPlugins/ToolImage.py @@ -224,8 +224,6 @@ class ImageUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # Type of object to create for the image diff --git a/appPlugins/ToolInvertGerber.py b/appPlugins/ToolInvertGerber.py index f3bf9ffc..70507236 100644 --- a/appPlugins/ToolInvertGerber.py +++ b/appPlugins/ToolInvertGerber.py @@ -271,8 +271,6 @@ class InvertUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.gp_frame.setLayout(grid0) # Margin diff --git a/appPlugins/ToolIsolation.py b/appPlugins/ToolIsolation.py index 4d3b27a0..4df21fec 100644 --- a/appPlugins/ToolIsolation.py +++ b/appPlugins/ToolIsolation.py @@ -3194,8 +3194,6 @@ class IsoUI: # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) tt_frame.setLayout(grid1) self.tools_table = FCTable(drag_drop=True) @@ -3245,8 +3243,6 @@ class IsoUI: grid1.addWidget(self.add_tool_frame, 6, 0, 1, 2) grid_add_tool = FCGridLayout(v_spacing=5, h_spacing=3) - grid_add_tool.setColumnStretch(0, 0) - grid_add_tool.setColumnStretch(1, 1) grid_add_tool.setContentsMargins(0, 0, 0, 0) self.add_tool_frame.setLayout(grid_add_tool) @@ -3359,8 +3355,6 @@ class IsoUI: # Grid Layout grid2 = FCGridLayout(v_spacing=5, h_spacing=3) - grid2.setColumnStretch(0, 0) - grid2.setColumnStretch(1, 1) tp_frame.setLayout(grid2) # Tool Type @@ -3493,8 +3487,6 @@ class IsoUI: self.tool_params_box.addWidget(gp_frame) grid3 = FCGridLayout(v_spacing=5, h_spacing=3) - grid3.setColumnStretch(0, 0) - grid3.setColumnStretch(1, 1) gp_frame.setLayout(grid3) # Rest Machining diff --git a/appPlugins/ToolLevelling.py b/appPlugins/ToolLevelling.py index e199a925..5b63e091 100644 --- a/appPlugins/ToolLevelling.py +++ b/appPlugins/ToolLevelling.py @@ -1799,8 +1799,6 @@ class LevelUI: self.al_frame.setLayout(self.al_box) grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.al_box.addLayout(grid0) self.al_title = FCLabel('%s' % _("Probe Points Table")) @@ -2025,10 +2023,7 @@ class LevelUI: # ############################################################################################################# # GRBL CONNECT # ############################################################################################################# - grbl_conn_grid = FCGridLayout(v_spacing=5, h_spacing=3) - grbl_conn_grid.setColumnStretch(0, 0) - grbl_conn_grid.setColumnStretch(1, 1) - grbl_conn_grid.setColumnStretch(2, 0) + grbl_conn_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) self.gr_conn_tab_layout.addLayout(grbl_conn_grid) # COM list @@ -2106,15 +2101,10 @@ class LevelUI: # ############################################################################################################# # GRBL CONTROL # ############################################################################################################# - grbl_ctrl_grid = FCGridLayout(v_spacing=5, h_spacing=3) - grbl_ctrl_grid.setColumnStretch(0, 0) - grbl_ctrl_grid.setColumnStretch(1, 1) - grbl_ctrl_grid.setColumnStretch(2, 0) + grbl_ctrl_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) self.gr_ctrl_tab_layout.addLayout(grbl_ctrl_grid) grbl_ctrl2_grid = FCGridLayout(v_spacing=5, h_spacing=3) - grbl_ctrl2_grid.setColumnStretch(0, 0) - grbl_ctrl2_grid.setColumnStretch(1, 1) self.gr_ctrl_tab_layout.addLayout(grbl_ctrl2_grid) self.gr_ctrl_tab_layout.addStretch(1) diff --git a/appPlugins/ToolMilling.py b/appPlugins/ToolMilling.py index f4b8501a..0e6c0405 100644 --- a/appPlugins/ToolMilling.py +++ b/appPlugins/ToolMilling.py @@ -3565,8 +3565,6 @@ class MillingUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) obj_frame.setLayout(grid0) self.target_label = FCLabel('%s:' % _("Type")) @@ -3605,8 +3603,6 @@ class MillingUI: # Grid Layout grid_title_tool_table = FCGridLayout(v_spacing=5, h_spacing=3) - grid_title_tool_table.setColumnStretch(0, 0) - grid_title_tool_table.setColumnStretch(1, 1) self.tools_box.addLayout(grid_title_tool_table) self.tools_table_label = FCLabel('%s' % _('Tools Table')) @@ -3626,8 +3622,6 @@ class MillingUI: # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) tt_frame.setLayout(grid1) # ################################################ @@ -3794,8 +3788,6 @@ class MillingUI: grid1.addWidget(self.add_tool_frame, 6, 0, 1, 2) grid__add_tool = FCGridLayout(v_spacing=5, h_spacing=3) - grid__add_tool.setColumnStretch(0, 0) - grid__add_tool.setColumnStretch(1, 1) grid__add_tool.setContentsMargins(0, 0, 0, 0) self.add_tool_frame.setLayout(grid__add_tool) @@ -3889,8 +3881,6 @@ class MillingUI: # Grid Layout grid2 = FCGridLayout(v_spacing=5, h_spacing=3) - grid2.setColumnStretch(0, 0) - grid2.setColumnStretch(1, 1) tp_frame.setLayout(grid2) # Milling Type @@ -4331,8 +4321,6 @@ class MillingUI: self.tool_params_box.addWidget(gp_frame) grid3 = FCGridLayout(v_spacing=5, h_spacing=3) - grid3.setColumnStretch(0, 0) - grid3.setColumnStretch(1, 1) gp_frame.setLayout(grid3) # Tool change Z: @@ -4546,8 +4534,6 @@ class MillingUI: self.exclusion_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) grid_a1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid_a1.setColumnStretch(0, 0) - grid_a1.setColumnStretch(1, 1) self.exclusion_box.addLayout(grid_a1) # Chose Strategy diff --git a/appPlugins/ToolNCC.py b/appPlugins/ToolNCC.py index 118ddae9..d11512d9 100644 --- a/appPlugins/ToolNCC.py +++ b/appPlugins/ToolNCC.py @@ -4142,8 +4142,6 @@ class NccUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) obj_frame.setLayout(grid0) # ############################################################################################################# @@ -4195,8 +4193,6 @@ class NccUI: # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) tt_frame.setLayout(grid1) self.tools_table = FCTable(drag_drop=True) @@ -4259,8 +4255,6 @@ class NccUI: grid1.addWidget(self.add_tool_frame, 6, 0, 1, 2) new_tool_grid = FCGridLayout(v_spacing=5, h_spacing=3) - new_tool_grid.setColumnStretch(0, 0) - new_tool_grid.setColumnStretch(1, 1) new_tool_grid.setContentsMargins(0, 0, 0, 0) self.add_tool_frame.setLayout(new_tool_grid) @@ -4362,8 +4356,6 @@ class NccUI: self.tools_box.addWidget(tt_frame) par_grid = FCGridLayout(v_spacing=5, h_spacing=3) - par_grid.setColumnStretch(0, 0) - par_grid.setColumnStretch(1, 1) tt_frame.setLayout(par_grid) # Operation @@ -4537,8 +4529,6 @@ class NccUI: self.tools_box.addWidget(gp_frame) gen_grid = FCGridLayout(v_spacing=5, h_spacing=3) - gen_grid.setColumnStretch(0, 0) - gen_grid.setColumnStretch(1, 1) gp_frame.setLayout(gen_grid) # Rest Machining diff --git a/appPlugins/ToolOptimal.py b/appPlugins/ToolOptimal.py index abe77921..39425a97 100644 --- a/appPlugins/ToolOptimal.py +++ b/appPlugins/ToolOptimal.py @@ -448,8 +448,6 @@ class OptimalUI: # ## Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) # ## Gerber Object to mirror diff --git a/appPlugins/ToolPaint.py b/appPlugins/ToolPaint.py index 0d7afbe9..d3483c57 100644 --- a/appPlugins/ToolPaint.py +++ b/appPlugins/ToolPaint.py @@ -2945,8 +2945,6 @@ class PaintUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) obj_frame.setLayout(grid0) # ############################################################################################################# @@ -2998,8 +2996,6 @@ class PaintUI: # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) tt_frame.setLayout(grid1) self.tools_table = FCTable(drag_drop=True) @@ -3061,8 +3057,6 @@ class PaintUI: grid1.addWidget(self.add_tool_frame, 6, 0, 1, 2) new_tool_grid = FCGridLayout(v_spacing=5, h_spacing=3) - new_tool_grid.setColumnStretch(0, 0) - new_tool_grid.setColumnStretch(1, 1) new_tool_grid.setContentsMargins(0, 0, 0, 0) self.add_tool_frame.setLayout(new_tool_grid) @@ -3147,8 +3141,6 @@ class PaintUI: self.tools_box.addWidget(tt_frame) par_grid = FCGridLayout(v_spacing=5, h_spacing=3) - par_grid.setColumnStretch(0, 0) - par_grid.setColumnStretch(1, 1) tt_frame.setLayout(par_grid) # Overlap @@ -3253,8 +3245,6 @@ class PaintUI: self.tools_box.addWidget(gp_frame) gen_grid = FCGridLayout(v_spacing=5, h_spacing=3) - gen_grid.setColumnStretch(0, 0) - gen_grid.setColumnStretch(1, 1) gp_frame.setLayout(gen_grid) # Rest machining diff --git a/appPlugins/ToolPanelize.py b/appPlugins/ToolPanelize.py index 91d38405..be2afc3b 100644 --- a/appPlugins/ToolPanelize.py +++ b/appPlugins/ToolPanelize.py @@ -1137,8 +1137,6 @@ class PanelizeUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) obj_frame.setLayout(grid0) # Type of object to be panelized @@ -1188,8 +1186,6 @@ class PanelizeUI: # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) pr_frame.setLayout(grid1) self.reference_radio = RadioSet([{'label': _('Object'), 'value': 'object'}, @@ -1245,8 +1241,6 @@ class PanelizeUI: self.tools_box.addWidget(pd_frame) grid2 = FCGridLayout(v_spacing=5, h_spacing=3) - grid2.setColumnStretch(0, 0) - grid2.setColumnStretch(1, 1) pd_frame.setLayout(grid2) # Spacing Columns @@ -1308,8 +1302,6 @@ class PanelizeUI: self.tools_box.addWidget(self.gp_frame) grid3 = FCGridLayout(v_spacing=5, h_spacing=3) - grid3.setColumnStretch(0, 0) - grid3.setColumnStretch(1, 1) self.gp_frame.setLayout(grid3) # Type of resulting Panel object diff --git a/appPlugins/ToolPcbWizard.py b/appPlugins/ToolPcbWizard.py index a1164b92..3272d3f1 100644 --- a/appPlugins/ToolPcbWizard.py +++ b/appPlugins/ToolPcbWizard.py @@ -417,8 +417,6 @@ class WizardUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) self.excellon_label = FCLabel('%s:' % _("Excellon file")) @@ -457,8 +455,6 @@ class WizardUI: # Grid Layout grid01 = FCGridLayout(v_spacing=5, h_spacing=3) - grid01.setColumnStretch(0, 0) - grid01.setColumnStretch(1, 1) self.layout.addLayout(grid01) # Integral part of the coordinates diff --git a/appPlugins/ToolPunchGerber.py b/appPlugins/ToolPunchGerber.py index a546bdf3..0d7cbe06 100644 --- a/appPlugins/ToolPunchGerber.py +++ b/appPlugins/ToolPunchGerber.py @@ -2002,8 +2002,6 @@ class PunchUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) # ## Gerber Object @@ -2031,12 +2029,9 @@ class PunchUI: self.tools_box.addWidget(tt_frame) pad_all_grid = FCGridLayout(v_spacing=5, h_spacing=3) - pad_all_grid.setColumnStretch(0, 0) - pad_all_grid.setColumnStretch(1, 1) tt_frame.setLayout(pad_all_grid) - pad_grid = FCGridLayout(v_spacing=5, h_spacing=3) - pad_grid.setColumnStretch(0, 0) + pad_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0]) pad_all_grid.addLayout(pad_grid, 0, 0) # Select all @@ -2129,8 +2124,6 @@ class PunchUI: # Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) m_frame.setLayout(grid1) self.method_punch = RadioSet( @@ -2202,8 +2195,6 @@ class PunchUI: # ## Grid Layout self.grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - self.grid1.setColumnStretch(0, 0) - self.grid1.setColumnStretch(1, 1) self.ring_box.addLayout(self.grid1) # Circular Annular Ring Value @@ -2303,8 +2294,6 @@ class PunchUI: # Grid Layout grid2 = FCGridLayout(v_spacing=5, h_spacing=3) - grid2.setColumnStretch(0, 0) - grid2.setColumnStretch(1, 1) self.s_frame.setLayout(grid2) # Type of doing the punch diff --git a/appPlugins/ToolQRCode.py b/appPlugins/ToolQRCode.py index 474fa606..07a9168d 100644 --- a/appPlugins/ToolQRCode.py +++ b/appPlugins/ToolQRCode.py @@ -770,8 +770,6 @@ class QRcodeUI: # ## Grid Layout i_grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) - i_grid_lay.setColumnStretch(0, 0) - i_grid_lay.setColumnStretch(1, 1) self.tools_box.addLayout(i_grid_lay) self.grb_object_combo = FCComboBox() @@ -803,8 +801,6 @@ class QRcodeUI: # Grid Layout grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) tq_frame.setLayout(grid0) self.text_data = FCTextArea() @@ -833,8 +829,6 @@ class QRcodeUI: # ## Grid Layout grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - grid1.setColumnStretch(0, 0) - grid1.setColumnStretch(1, 1) p_frame.setLayout(grid1) # VERSION # @@ -948,8 +942,6 @@ class QRcodeUI: self.tools_box.addWidget(self.export_frame) self.export_lay = FCGridLayout(v_spacing=5, h_spacing=3) - self.export_lay.setColumnStretch(0, 0) - self.export_lay.setColumnStretch(1, 1) self.export_frame.setLayout(self.export_lay) # default is hidden diff --git a/appPlugins/ToolRulesCheck.py b/appPlugins/ToolRulesCheck.py index 1f44bf81..91cbb0ca 100644 --- a/appPlugins/ToolRulesCheck.py +++ b/appPlugins/ToolRulesCheck.py @@ -1193,13 +1193,9 @@ class RulesUI: self.layout.addWidget(title_label) # Form Layout - self.grid_layout = FCGridLayout(v_spacing=5, h_spacing=3) + self.grid_layout = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 3, 0]) self.layout.addLayout(self.grid_layout) - self.grid_layout.setColumnStretch(0, 0) - self.grid_layout.setColumnStretch(1, 3) - self.grid_layout.setColumnStretch(2, 0) - self.gerber_title_lbl = FCLabel('%s:' % _("GERBER")) self.gerber_title_lbl.setToolTip( _("Gerber objects for which to check rules.") @@ -1399,8 +1395,6 @@ class RulesUI: # Form Layout self.grid_lay1 = FCGridLayout(v_spacing=5, h_spacing=3) - self.grid_lay1.setColumnStretch(0, 0) - self.grid_lay1.setColumnStretch(1, 1) self.layout.addLayout(self.grid_lay1) self.grid_lay1.addWidget(FCLabel(""), 0, 0, 1, 2) diff --git a/appPlugins/ToolSolderPaste.py b/appPlugins/ToolSolderPaste.py index a91a8e70..d145506f 100644 --- a/appPlugins/ToolSolderPaste.py +++ b/appPlugins/ToolSolderPaste.py @@ -1193,8 +1193,6 @@ class SolderUI: # ## Form Layout obj_form_layout = FCGridLayout(v_spacing=5, h_spacing=3) - obj_form_layout.setColumnStretch(0, 0) - obj_form_layout.setColumnStretch(1, 1) self.layout.addLayout(obj_form_layout) # ## Gerber Object to be used for solderpaste dispensing @@ -1245,8 +1243,6 @@ class SolderUI: # ### Add a new Tool ## ## grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) self.addtool_entry_lbl = FCLabel('%s:' % _('New Tool')) @@ -1504,8 +1500,6 @@ class SolderUI: # Buttons Grid self.button_grid = FCGridLayout(v_spacing=5, h_spacing=3) - self.button_grid.setColumnStretch(0, 0) - self.button_grid.setColumnStretch(1, 1) self.tool_box.addLayout(self.button_grid) # Generate Geometry diff --git a/appPlugins/ToolSub.py b/appPlugins/ToolSub.py index dddec8fc..4c8db88c 100644 --- a/appPlugins/ToolSub.py +++ b/appPlugins/ToolSub.py @@ -819,8 +819,6 @@ class SubUI: self.tools_box.addWidget(self.gp_frame) param_grid = FCGridLayout(v_spacing=5, h_spacing=3) - param_grid.setColumnStretch(0, 0) - param_grid.setColumnStretch(1, 1) self.gp_frame.setLayout(param_grid) self.delete_sources_cb = FCCheckBox(_("Delete source")) @@ -840,8 +838,6 @@ class SubUI: self.tools_box.addWidget(grb_frame) grb_grid = FCGridLayout(v_spacing=5, h_spacing=3) - grb_grid.setColumnStretch(0, 0) - grb_grid.setColumnStretch(1, 1) grb_frame.setLayout(grb_grid) # Target Gerber Object @@ -907,9 +903,8 @@ class SubUI: self.tools_box.addWidget(geo_frame) geo_grid = FCGridLayout(v_spacing=5, h_spacing=3) - geo_grid.setColumnStretch(0, 0) - geo_grid.setColumnStretch(1, 1) geo_frame.setLayout(geo_grid) + self.geo_title = FCLabel("%s" % _("GEOMETRY")) self.tools_box.addWidget(self.geo_title) diff --git a/appPlugins/ToolTransform.py b/appPlugins/ToolTransform.py index eb78c514..20775cd0 100644 --- a/appPlugins/ToolTransform.py +++ b/appPlugins/ToolTransform.py @@ -597,11 +597,8 @@ class TransformUI: self.layout.addWidget(title_label) # ## Layout - grid0 = FCGridLayout(v_spacing=5, h_spacing=3) + grid0 = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) self.layout.addLayout(grid0) - grid0.setColumnStretch(0, 0) - grid0.setColumnStretch(1, 1) - grid0.setColumnStretch(2, 0) # Reference ref_label = FCLabel('%s:' % _("Reference")) diff --git a/app_Main.py b/app_Main.py index 43f65da0..0c7ce486 100644 --- a/app_Main.py +++ b/app_Main.py @@ -3425,10 +3425,8 @@ class App(QtCore.QObject): }, ] - self.prog_grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) + self.prog_grid_lay = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 0, 1]) self.prog_grid_lay.setHorizontalSpacing(20) - self.prog_grid_lay.setColumnStretch(0, 0) - self.prog_grid_lay.setColumnStretch(2, 1) prog_widget = QtWidgets.QWidget() prog_widget.setLayout(self.prog_grid_lay) @@ -3468,11 +3466,7 @@ class App(QtCore.QObject): self.prog_grid_lay.addWidget(FCLabel(''), line, 0) line += 1 - self.translator_grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) - self.translator_grid_lay.setColumnStretch(0, 0) - self.translator_grid_lay.setColumnStretch(1, 0) - self.translator_grid_lay.setColumnStretch(2, 1) - self.translator_grid_lay.setColumnStretch(3, 0) + self.translator_grid_lay = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 0, 1, 0]) # trans_widget = QtWidgets.QWidget() # trans_widget.setLayout(self.translator_grid_lay) @@ -3679,10 +3673,8 @@ class App(QtCore.QObject): self.intro_tab_layout.setContentsMargins(2, 2, 2, 2) tab_widget.addTab(self.intro_tab, _("Contribute")) - self.grid_lay = FCGridLayout(v_spacing=5, h_spacing=3) - self.grid_lay.setHorizontalSpacing(20) - self.grid_lay.setColumnStretch(0, 0) - self.grid_lay.setColumnStretch(1, 1) + self.grid_lay = FCGridLayout(v_spacing=5, h_spacing=20) + # self.grid_lay.setHorizontalSpacing(20) intro_wdg = QtWidgets.QWidget() intro_wdg.setLayout(self.grid_lay)