From 461aa763ad717328c73bb894d082a015ad410f67 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sat, 7 Aug 2021 11:46:45 +0300 Subject: [PATCH] - created a new custom layout based on the Grid Layout where I can set the horizontal and vertical spacings between grid items and used it throughout the app --- Bookmark.py | 4 +- CHANGELOG.md | 1 + appDatabase.py | 18 +++--- appEditors/AppExcEditor.py | 20 +++--- appEditors/AppGeoEditor.py | 14 ++--- appEditors/AppGerberEditor.py | 18 +++--- appEditors/AppTextEditor.py | 3 +- appEditors/appGCodeEditor.py | 4 +- appGUI/GUIElements.py | 62 +++++++++++++------ appGUI/ObjectUI.py | 24 +++---- appGUI/preferences/OptionUI.py | 2 +- appGUI/preferences/OptionsGroupUI.py | 3 +- .../cncjob/CNCJobAdvOptPrefGroupUI.py | 4 +- .../cncjob/CNCJobGenPrefGroupUI.py | 4 +- .../cncjob/CNCJobOptPrefGroupUI.py | 4 +- .../excellon/ExcellonAdvOptPrefGroupUI.py | 4 +- .../excellon/ExcellonEditorPrefGroupUI.py | 4 +- .../excellon/ExcellonExpPrefGroupUI.py | 4 +- .../excellon/ExcellonGenPrefGroupUI.py | 6 +- .../excellon/ExcellonOptPrefGroupUI.py | 4 +- .../general/GeneralAPPSetGroupUI.py | 4 +- .../general/GeneralAppPrefGroupUI.py | 4 +- .../general/GeneralGUIPrefGroupUI.py | 5 +- .../geometry/GeometryAdvOptPrefGroupUI.py | 4 +- .../geometry/GeometryEditorPrefGroupUI.py | 4 +- .../geometry/GeometryExpPrefGroupUI.py | 4 +- .../geometry/GeometryGenPrefGroupUI.py | 4 +- .../geometry/GeometryOptPrefGroupUI.py | 4 +- .../gerber/GerberAdvOptPrefGroupUI.py | 4 +- .../gerber/GerberEditorPrefGroupUI.py | 5 +- .../gerber/GerberExpPrefGroupUI.py | 4 +- .../gerber/GerberGenPrefGroupUI.py | 5 +- .../gerber/GerberOptPrefGroupUI.py | 6 +- .../tools/Tools2CThievingPrefGroupUI.py | 4 +- .../preferences/tools/Tools2CalPrefGroupUI.py | 4 +- .../tools/Tools2ExtractPrefGroupUI.py | 4 +- .../tools/Tools2FiducialsPrefGroupUI.py | 4 +- .../tools/Tools2InvertPrefGroupUI.py | 4 +- .../tools/Tools2OptimalPrefGroupUI.py | 4 +- .../tools/Tools2PunchGerberPrefGroupUI.py | 4 +- .../tools/Tools2QRCodePrefGroupUI.py | 4 +- .../tools/Tools2RulesCheckPrefGroupUI.py | 4 +- .../tools/Tools2sidedPrefGroupUI.py | 4 +- .../tools/ToolsCalculatorsPrefGroupUI.py | 4 +- .../tools/ToolsCornersPrefGroupUI.py | 4 +- .../tools/ToolsCutoutPrefGroupUI.py | 5 +- .../tools/ToolsDrillPrefGroupUI.py | 4 +- .../preferences/tools/ToolsFilmPrefGroupUI.py | 5 +- .../preferences/tools/ToolsISOPrefGroupUI.py | 4 +- .../tools/ToolsLevelPrefGroupUI.py | 4 +- .../preferences/tools/ToolsMillPrefGroupUI.py | 4 +- .../preferences/tools/ToolsNCCPrefGroupUI.py | 5 +- .../tools/ToolsPaintPrefGroupUI.py | 5 +- .../tools/ToolsPanelizePrefGroupUI.py | 4 +- .../tools/ToolsSolderpastePrefGroupUI.py | 4 +- .../tools/ToolsTransformPrefGroupUI.py | 4 +- appPlugins/ToolAlignObjects.py | 4 +- appPlugins/ToolCalculators.py | 9 +-- appPlugins/ToolCalibration.py | 4 +- appPlugins/ToolCopperThieving.py | 15 ++--- appPlugins/ToolCorners.py | 7 ++- appPlugins/ToolCutOut.py | 4 +- appPlugins/ToolDblSided.py | 14 ++--- appPlugins/ToolDistance.py | 4 +- appPlugins/ToolDistanceMin.py | 4 +- appPlugins/ToolDrilling.py | 12 ++-- appPlugins/ToolEtchCompensation.py | 4 +- appPlugins/ToolExtract.py | 15 ++--- appPlugins/ToolFiducials.py | 4 +- appPlugins/ToolFilm.py | 9 +-- appPlugins/ToolFollow.py | 4 +- appPlugins/ToolImage.py | 4 +- appPlugins/ToolInvertGerber.py | 5 +- appPlugins/ToolIsolation.py | 9 +-- appPlugins/ToolLevelling.py | 12 ++-- appPlugins/ToolMilling.py | 16 ++--- appPlugins/ToolNCC.py | 11 ++-- appPlugins/ToolOptimal.py | 4 +- appPlugins/ToolPaint.py | 10 +-- appPlugins/ToolPanelize.py | 4 +- appPlugins/ToolPcbWizard.py | 6 +- appPlugins/ToolPunchGerber.py | 12 ++-- appPlugins/ToolQRCode.py | 8 +-- appPlugins/ToolRulesCheck.py | 6 +- appPlugins/ToolSolderPaste.py | 10 +-- appPlugins/ToolSub.py | 4 +- appPlugins/ToolTransform.py | 4 +- app_Main.py | 8 +-- 88 files changed, 325 insertions(+), 281 deletions(-) diff --git a/Bookmark.py b/Bookmark.py index eba75240..17700c58 100644 --- a/Bookmark.py +++ b/Bookmark.py @@ -1,5 +1,5 @@ from PyQt6 import QtGui, QtCore, QtWidgets -from appGUI.GUIElements import FCTable, FCEntry, FCButton, FCFileSaveDialog +from appGUI.GUIElements import FCTable, FCEntry, FCButton, FCFileSaveDialog, FCGridLayout import sys import webbrowser @@ -78,7 +78,7 @@ class BookmarkManager(QtWidgets.QWidget): new_title_lbl = QtWidgets.QLabel('%s' % _("New Bookmark")) new_vlay.addWidget(new_title_lbl) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) new_vlay.addLayout(grid0) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6644e08a..36488a5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ CHANGELOG for FlatCAM beta - more changes due of porting to PyQt6 - fixed the Autocompleter highlighting to work in PyQt6 +- created a new custom layout based on the Grid Layout where I can set the horizontal and vertical spacings between grid items and used it throughout the app 5.08.2021 diff --git a/appDatabase.py b/appDatabase.py index aa1c72df..0703b898 100644 --- a/appDatabase.py +++ b/appDatabase.py @@ -1,6 +1,6 @@ from PyQt6 import QtGui, QtCore, QtWidgets from appGUI.GUIElements import FCEntry, FCButton, FCDoubleSpinner, FCComboBox, FCCheckBox, FCSpinner, \ - FCTree, RadioSet, FCFileSaveDialog, FCLabel, FCComboBox2 + FCTree, RadioSet, FCFileSaveDialog, FCLabel, FCComboBox2, FCGridLayout from camlib import to_dict import sys @@ -193,7 +193,7 @@ class ToolsDB2UI: # ########################################################################### # ################ Tool UI form ############################################# # ########################################################################### - self.grid_tool = QtWidgets.QGridLayout() + self.grid_tool = FCGridLayout(v_spacing=3) self.description_vlay.addLayout(self.grid_tool) self.grid_tool.setColumnStretch(0, 0) self.grid_tool.setColumnStretch(1, 1) @@ -277,7 +277,7 @@ class ToolsDB2UI: # ########################################################################### # ############### MILLING UI form ########################################### # ########################################################################### - self.grid0 = QtWidgets.QGridLayout() + self.grid0 = FCGridLayout(v_spacing=3) self.milling_vlay.addLayout(self.grid0) self.grid0.setColumnStretch(0, 0) self.grid0.setColumnStretch(1, 1) @@ -576,7 +576,7 @@ class ToolsDB2UI: # ############### NCC UI form ############################################### # ########################################################################### - self.grid2 = QtWidgets.QGridLayout() + self.grid2 = FCGridLayout(v_spacing=3) self.ncc_vlay.addLayout(self.grid2) self.grid2.setColumnStretch(0, 0) self.grid2.setColumnStretch(1, 1) @@ -722,7 +722,7 @@ class ToolsDB2UI: # ############### Paint UI form ############################################# # ########################################################################### - self.grid3 = QtWidgets.QGridLayout() + self.grid3 = FCGridLayout(v_spacing=3) self.paint_vlay.addLayout(self.grid3) self.grid3.setColumnStretch(0, 0) self.grid3.setColumnStretch(1, 1) @@ -811,7 +811,7 @@ class ToolsDB2UI: # ############### Isolation UI form ######################################### # ########################################################################### - self.grid4 = QtWidgets.QGridLayout() + self.grid4 = FCGridLayout(v_spacing=3) self.iso_vlay.addLayout(self.grid4) self.grid4.setColumnStretch(0, 0) self.grid4.setColumnStretch(1, 1) @@ -888,7 +888,7 @@ class ToolsDB2UI: # ########################################################################### # ################ DRILLING UI form ######################################### # ########################################################################### - self.grid5 = QtWidgets.QGridLayout() + self.grid5 = FCGridLayout(v_spacing=3) self.drill_vlay.addLayout(self.grid5) self.grid5.setColumnStretch(0, 0) self.grid5.setColumnStretch(1, 1) @@ -1113,7 +1113,7 @@ class ToolsDB2UI: # ########################################################################### # ################### Cutout UI form ######################################## # ########################################################################### - self.grid6 = QtWidgets.QGridLayout() + self.grid6 = FCGridLayout(v_spacing=3) self.cutout_vlay.addLayout(self.grid6) self.grid6.setColumnStretch(0, 0) self.grid6.setColumnStretch(1, 1) @@ -1399,7 +1399,7 @@ class ToolsDB2(QtWidgets.QWidget): # TOOLS DATABASE UI # ############################################################################## # ############################################################################## - layout = QtWidgets.QGridLayout() + layout = FCGridLayout(v_spacing=3) layout.setColumnStretch(0, 0) layout.setColumnStretch(1, 1) self.setLayout(layout) diff --git a/appEditors/AppExcEditor.py b/appEditors/AppExcEditor.py index b0aacc61..7886aeed 100644 --- a/appEditors/AppExcEditor.py +++ b/appEditors/AppExcEditor.py @@ -9,7 +9,7 @@ from PyQt6 import QtGui, QtCore, QtWidgets from PyQt6.QtCore import Qt from camlib import distance, arc, FlatCAMRTreeStorage -from appGUI.GUIElements import FCEntry, FCTable, FCDoubleSpinner, RadioSet, FCSpinner, FCButton, FCLabel +from appGUI.GUIElements import FCEntry, FCTable, FCDoubleSpinner, RadioSet, FCSpinner, FCButton, FCLabel, FCGridLayout from appEditors.AppGeoEditor import FCShapeTool, DrawTool, DrawToolShape, DrawToolUtilityShape, AppGeoEditor from shapely.geometry import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, Point @@ -4060,7 +4060,7 @@ class AppExcEditorUI: # ############################################################################################################# # ######################## ADD New Tool Grid ################################################################## # ############################################################################################################# - grid1 = QtWidgets.QGridLayout() + grid1 = FCGridLayout(v_spacing=3) grid1.setColumnStretch(0, 0) grid1.setColumnStretch(1, 1) self.ui_vertical_lay.addLayout(grid1) @@ -4114,7 +4114,7 @@ class AppExcEditorUI: self.resize_frame.setContentsMargins(0, 0, 0, 0) self.ui_vertical_lay.addWidget(self.resize_frame) - self.resize_grid = QtWidgets.QGridLayout() + self.resize_grid = FCGridLayout(v_spacing=3) self.resize_grid.setColumnStretch(0, 0) self.resize_grid.setColumnStretch(1, 1) self.resize_grid.setContentsMargins(0, 0, 0, 0) @@ -4170,7 +4170,7 @@ class AppExcEditorUI: self.array_frame.setContentsMargins(0, 0, 0, 0) self.ui_vertical_lay.addWidget(self.array_frame) - self.array_grid = QtWidgets.QGridLayout() + self.array_grid = FCGridLayout(v_spacing=3) self.array_grid.setColumnStretch(0, 0) self.array_grid.setColumnStretch(1, 1) self.array_grid.setContentsMargins(0, 0, 0, 0) @@ -4213,7 +4213,7 @@ class AppExcEditorUI: self.array_linear_frame = QtWidgets.QFrame() self.array_linear_frame.setContentsMargins(0, 0, 0, 0) self.array_grid.addWidget(self.array_linear_frame, 6, 0, 1, 2) - self.lin_grid = QtWidgets.QGridLayout() + self.lin_grid = FCGridLayout(v_spacing=3) self.lin_grid.setColumnStretch(0, 0) self.lin_grid.setColumnStretch(1, 1) self.lin_grid.setContentsMargins(0, 0, 0, 0) @@ -4272,7 +4272,7 @@ class AppExcEditorUI: self.array_circular_frame.setContentsMargins(0, 0, 0, 0) self.array_grid.addWidget(self.array_circular_frame, 8, 0, 1, 2) - self.circ_grid = QtWidgets.QGridLayout() + self.circ_grid = FCGridLayout(v_spacing=3) self.circ_grid.setColumnStretch(0, 0) self.circ_grid.setColumnStretch(1, 1) self.circ_grid.setContentsMargins(0, 0, 0, 0) @@ -4316,7 +4316,7 @@ class AppExcEditorUI: self.slot_frame.setContentsMargins(0, 0, 0, 0) self.ui_vertical_lay.addWidget(self.slot_frame) - self.slot_grid = QtWidgets.QGridLayout() + self.slot_grid = FCGridLayout(v_spacing=3) self.slot_grid.setColumnStretch(0, 0) self.slot_grid.setColumnStretch(1, 1) self.slot_grid.setContentsMargins(0, 0, 0, 0) @@ -4390,7 +4390,7 @@ class AppExcEditorUI: self.slot_array_frame.setContentsMargins(0, 0, 0, 0) self.ui_vertical_lay.addWidget(self.slot_array_frame) - self.slot_array_grid = QtWidgets.QGridLayout() + self.slot_array_grid = FCGridLayout(v_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) @@ -4434,7 +4434,7 @@ class AppExcEditorUI: self.slot_array_linear_frame.setContentsMargins(0, 0, 0, 0) self.slot_array_grid.addWidget(self.slot_array_linear_frame, 6, 0, 1, 2) - self.slot_array_lin_grid = QtWidgets.QGridLayout() + self.slot_array_lin_grid = FCGridLayout(v_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) @@ -4494,7 +4494,7 @@ class AppExcEditorUI: self.slot_array_circular_frame.setContentsMargins(0, 0, 0, 0) self.slot_array_grid.addWidget(self.slot_array_circular_frame, 8, 0, 1, 2) - self.slot_array_circ_grid = QtWidgets.QGridLayout() + self.slot_array_circ_grid = FCGridLayout(v_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) diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index a869e957..1980051a 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -20,7 +20,7 @@ from camlib import distance, arc, three_point_circle, Geometry, FlatCAMRTreeStor from appTool import AppTool from appGUI.GUIElements import OptionalInputSection, FCCheckBox, FCLabel, FCComboBox, FCTextAreaRich, \ FCDoubleSpinner, FCButton, FCInputDoubleSpinner, FCTree, NumericalEvalTupleEntry, FCEntry, FCTextEdit, \ - VerticalScrollArea + VerticalScrollArea, FCGridLayout from appParsers.ParseFont import * from vispy.geometry import Rect @@ -83,7 +83,7 @@ class BufferSelectionTool(AppTool): self.buffer_tool_frame.setLayout(self.buffer_tools_box) # Grid Layout - grid_buffer = QtWidgets.QGridLayout() + grid_buffer = FCGridLayout(v_spacing=3) grid_buffer.setColumnStretch(0, 0) grid_buffer.setColumnStretch(1, 1) self.buffer_tools_box.addLayout(grid_buffer) @@ -267,7 +267,7 @@ class TextInputTool(AppTool): self.text_tools_box.addWidget(title_label) # Grid Layout - self.grid_text = QtWidgets.QGridLayout() + self.grid_text = FCGridLayout(v_spacing=3) self.grid_text.setColumnStretch(0, 0) self.grid_text.setColumnStretch(1, 1) self.text_tools_box.addLayout(self.grid_text) @@ -505,7 +505,7 @@ class PaintOptionsTool(AppTool): """) self.layout.addWidget(title_label) - grid = QtWidgets.QGridLayout() + grid = FCGridLayout(v_spacing=3) self.layout.addLayout(grid) grid.setColumnStretch(0, 0) grid.setColumnStretch(1, 1) @@ -735,7 +735,7 @@ class TransformEditorTool(AppTool): self.layout.addWidget(FCLabel('')) # ## Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) @@ -3457,7 +3457,7 @@ class AppGeoEditor(QtCore.QObject): self.level.setCheckable(True) self.title_box.addWidget(self.level) - self.grid_d = QtWidgets.QGridLayout() + self.grid_d = FCGridLayout(v_spacing=3) self.grid_d.setColumnStretch(0, 0) self.grid_d.setColumnStretch(1, 1) self.tools_box.addLayout(self.grid_d) @@ -3501,7 +3501,7 @@ class AppGeoEditor(QtCore.QObject): self.adv_frame.setContentsMargins(0, 0, 0, 0) self.tools_box.addWidget(self.adv_frame) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) grid0.setContentsMargins(0, 0, 0, 0) diff --git a/appEditors/AppGerberEditor.py b/appEditors/AppGerberEditor.py index 934664ff..ee00ed1c 100644 --- a/appEditors/AppGerberEditor.py +++ b/appEditors/AppGerberEditor.py @@ -20,7 +20,7 @@ import logging from camlib import distance, arc, three_point_circle from appGUI.GUIElements import FCEntry, FCComboBox, FCTable, FCDoubleSpinner, FCSpinner, RadioSet, EvalEntry2, \ FCInputDoubleSpinner, FCButton, OptionalInputSection, FCCheckBox, NumericalEvalTupleEntry, FCLabel, FCTextEdit, \ - VerticalScrollArea + VerticalScrollArea, FCGridLayout from appTool import AppTool import numpy as np @@ -6090,7 +6090,7 @@ class AppGerberEditorUI: # ############################################################################################################# # ############################ Add/Delete an new Aperture ##################################################### # ############################################################################################################# - grid1 = QtWidgets.QGridLayout() + grid1 = FCGridLayout(v_spacing=3) self.apertures_box.addLayout(grid1) grid1.setColumnStretch(0, 0) grid1.setColumnStretch(1, 1) @@ -6191,7 +6191,7 @@ class AppGerberEditorUI: self.shape_frame.setContentsMargins(0, 0, 0, 0) self.custom_box.addWidget(self.shape_frame) - self.shape_grid = QtWidgets.QGridLayout() + self.shape_grid = FCGridLayout(v_spacing=3) self.shape_grid.setColumnStretch(0, 0) self.shape_grid.setColumnStretch(1, 1) self.shape_grid.setContentsMargins(0, 0, 0, 0) @@ -6213,7 +6213,7 @@ class AppGerberEditorUI: ) self.shape_grid.addWidget(param_title, 4, 0, 1, 3) - p_grid = QtWidgets.QGridLayout() + p_grid = FCGridLayout(v_spacing=3) p_grid.setColumnStretch(0, 0) p_grid.setColumnStretch(1, 0) p_grid.setColumnStretch(2, 0) @@ -6330,7 +6330,7 @@ class AppGerberEditorUI: self.buffer_tools_box.addWidget(buf_title_lbl) # Grid Layout - buff_grid = QtWidgets.QGridLayout() + buff_grid = FCGridLayout(v_spacing=3) buff_grid.setColumnStretch(0, 0) buff_grid.setColumnStretch(1, 1) self.buffer_tools_box.addLayout(buff_grid) @@ -6390,7 +6390,7 @@ class AppGerberEditorUI: self.scale_tools_box.addWidget(scale_title_lbl) # Grid Layout - scale_grid = QtWidgets.QGridLayout() + scale_grid = FCGridLayout(v_spacing=3) scale_grid.setColumnStretch(0, 0) scale_grid.setColumnStretch(1, 1) self.scale_tools_box.addLayout(scale_grid) @@ -6441,7 +6441,7 @@ class AppGerberEditorUI: self.ma_tools_box.addWidget(ma_title_lbl) # Form Layout - mark_grid = QtWidgets.QGridLayout() + mark_grid = FCGridLayout(v_spacing=3) mark_grid.setColumnStretch(0, 0) mark_grid.setColumnStretch(1, 1) self.ma_tools_box.addLayout(mark_grid) @@ -6512,7 +6512,7 @@ class AppGerberEditorUI: separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) self.array_box.addWidget(separator_line) - array_grid = QtWidgets.QGridLayout() + array_grid = FCGridLayout(v_spacing=3) array_grid.setColumnStretch(0, 0) array_grid.setColumnStretch(1, 1) self.array_box.addLayout(array_grid) @@ -6689,7 +6689,7 @@ class TransformEditorTool(AppTool): self.layout.addWidget(FCLabel('')) # ## Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) diff --git a/appEditors/AppTextEditor.py b/appEditors/AppTextEditor.py index ff4ebc3c..ff314c0c 100644 --- a/appEditors/AppTextEditor.py +++ b/appEditors/AppTextEditor.py @@ -5,7 +5,8 @@ # MIT Licence # # ########################################################## -from appGUI.GUIElements import FCFileSaveDialog, FCEntry, FCTextAreaExtended, FCTextAreaLineNumber, FCButton +from appGUI.GUIElements import FCFileSaveDialog, FCEntry, FCTextAreaExtended, FCTextAreaLineNumber, FCButton, \ + FCGridLayout from PyQt6 import QtPrintSupport, QtWidgets, QtCore, QtGui from reportlab.platypus import SimpleDocTemplate, Paragraph diff --git a/appEditors/appGCodeEditor.py b/appEditors/appGCodeEditor.py index ab63a37c..da1aff45 100644 --- a/appEditors/appGCodeEditor.py +++ b/appEditors/appGCodeEditor.py @@ -7,7 +7,7 @@ from appEditors.AppTextEditor import AppTextEditor from appObjects.FlatCAMCNCJob import CNCJobObject -from appGUI.GUIElements import FCTextArea, FCEntry, FCButton, FCTable +from appGUI.GUIElements import FCTextArea, FCEntry, FCButton, FCTable, FCGridLayout from PyQt6 import QtWidgets, QtCore, QtGui # from io import StringIO @@ -827,7 +827,7 @@ class AppGCodeEditorUI: self.snippet_frame.setContentsMargins(0, 0, 0, 0) self.edit_box.addWidget(self.snippet_frame) - self.snippet_grid = QtWidgets.QGridLayout() + self.snippet_grid = FCGridLayout(v_spacing=3) # self.snippet_grid.setColumnStretch(0, 0) # self.snippet_grid.setColumnStretch(1, 1) self.snippet_grid.setContentsMargins(0, 0, 0, 0) diff --git a/appGUI/GUIElements.py b/appGUI/GUIElements.py index 91caed23..8599856c 100644 --- a/appGUI/GUIElements.py +++ b/appGUI/GUIElements.py @@ -2200,7 +2200,8 @@ class FCComboBox(QtWidgets.QComboBox): self._obj_type = None if policy is True: - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, + QtWidgets.QSizePolicy.Policy.Preferred) self.setSizePolicy(sizePolicy) # the callback() will be called on customcontextmenu event and will be be passed 2 parameters: @@ -3204,7 +3205,8 @@ class FCDetachableTab(QtWidgets.QTabWidget): """ # Determine if the current movement is detected as a drag if not self.dragStartPos.isNull() and ( - (event.position().toPoint() - self.dragStartPos).manhattanLength() < QtWidgets.QApplication.startDragDistance()): + ((event.position().toPoint() - self.dragStartPos).manhattanLength()) < + QtWidgets.QApplication.startDragDistance()): self.dragInitiated = True # If the current movement is a drag initiated by the left button @@ -4244,7 +4246,8 @@ class _ExpandableTextEdit(FCTextEdit): if line_count <= 1: self.historyPrev.emit() return - elif event.matches(QKeySequence.StandardKey.MoveToNextPage) or event.matches(QKeySequence.StandardKey.MoveToPreviousPage): + elif event.matches(QKeySequence.StandardKey.MoveToNextPage) or \ + event.matches(QKeySequence.StandardKey.MoveToPreviousPage): return self._termWidget.browser().keyPressEvent(event) elif event.key() == QtCore.Qt.Key.Key_Escape: self.on_escape_key() @@ -4727,7 +4730,7 @@ class FCJog(QtWidgets.QFrame): self.setLineWidth(1) # JOG axes - grbl_jog_grid = QtWidgets.QGridLayout() + grbl_jog_grid = FCGridLayout(v_spacing=3) grbl_jog_grid.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) grbl_jog_grid.setSizeConstraint(QtWidgets.QLayout.SizeConstraint.SetMinimumSize) grbl_jog_grid.setContentsMargins(2, 4, 2, 4) @@ -4806,7 +4809,7 @@ class FCZeroAxes(QtWidgets.QFrame): self.setLineWidth(1) # Zero the axes - grbl_zero_grid = QtWidgets.QGridLayout() + grbl_zero_grid = FCGridLayout(v_spacing=3) grbl_zero_grid.setContentsMargins(2, 4, 2, 4) grbl_zero_grid.setColumnStretch(0, 0) grbl_zero_grid.setColumnStretch(1, 0) @@ -4844,7 +4847,8 @@ class FCZeroAxes(QtWidgets.QFrame): # Zeroo all axes self.grbl_zero_all_button = QtWidgets.QToolButton() self.grbl_zero_all_button.setText(_("All")) - self.grbl_zero_all_button.setSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.grbl_zero_all_button.setSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, + QtWidgets.QSizePolicy.Policy.Expanding) self.grbl_zero_all_button.setToolTip( _("Zero all CNC axes at current position.") @@ -4883,11 +4887,11 @@ class RotatedToolButton(QtWidgets.QToolButton): size = options.rect.size() size.transpose() options.rect.setSize(size) - options.features = QtWidgets.QStyleOptionButton.None_ + options.features = QtWidgets.QStyleOptionButton.ButtonFeature.None_ # if self.isFlat(): # options.features |= QtWidgets.QStyleOptionButton.Flat if self.menu(): - options.features |= QtWidgets.QStyleOptionButton.HasMenu + options.features |= QtWidgets.QStyleOptionButton.ButtonFeature.HasMenu # if self.autoDefault() or self.isDefault(): # options.features |= QtWidgets.QStyleOptionButton.AutoDefaultButton # if self.isDefault(): @@ -4936,15 +4940,15 @@ class RotatedButton(QtWidgets.QPushButton): size = options.rect.size() size.transpose() options.rect.setSize(size) - options.features = QtWidgets.QStyleOptionButton.None_ + options.features = QtWidgets.QStyleOptionButton.ButtonFeature.None_ if self.isFlat(): - options.features |= QtWidgets.QStyleOptionButton.Flat + options.features |= QtWidgets.QStyleOptionButton.ButtonFeature.Flat if self.menu(): - options.features |= QtWidgets.QStyleOptionButton.HasMenu + options.features |= QtWidgets.QStyleOptionButton.ButtonFeature.HasMenu if self.autoDefault() or self.isDefault(): - options.features |= QtWidgets.QStyleOptionButton.AutoDefaultButton + options.features |= QtWidgets.QStyleOptionButton.ButtonFeature.AutoDefaultButton if self.isDefault(): - options.features |= QtWidgets.QStyleOptionButton.DefaultButton + options.features |= QtWidgets.QStyleOptionButton.ButtonFeature.DefaultButton if self.isDown() or (self.menu() and self.menu().isVisible()): options.state |= QtWidgets.QStyle.State_Sunken if self.isChecked(): @@ -5113,7 +5117,7 @@ class FlatCAMSystemTray(QtWidgets.QSystemTrayIcon): menu = QtWidgets.QMenu(parent) menu_runscript = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/script14.png'), - '%s' % _('Run Script ...'), self) + '%s' % _('Run Script ...'), self) menu_runscript.setToolTip( _("Will run the opened Tcl Script thus\n" "enabling the automation of certain\n" @@ -5128,23 +5132,23 @@ class FlatCAMSystemTray(QtWidgets.QSystemTrayIcon): # Open Project ... menu_openproject = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/folder16.png'), - '%s ...' % _('Open Project'), self) + '%s ...' % _('Open Project'), self) self.menu_open.addAction(menu_openproject) self.menu_open.addSeparator() # Open Gerber ... menu_opengerber = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/flatcam_icon24.png'), - '%s ...\t%s' % (_('Open Gerber'), _('Ctrl+G')), self) + '%s ...\t%s' % (_('Open Gerber'), _('Ctrl+G')), self) self.menu_open.addAction(menu_opengerber) # Open Excellon ... menu_openexcellon = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/open_excellon32.png'), - '%s ...\t%s' % (_('Open Excellon'), _('Ctrl+E')), self) + '%s ...\t%s' % (_('Open Excellon'), _('Ctrl+E')), self) self.menu_open.addAction(menu_openexcellon) # Open G-Code ... menu_opengcode = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/code.png'), - '%s ...' % _('Open G-Code'), self) + '%s ...' % _('Open G-Code'), self) self.menu_open.addAction(menu_opengcode) self.menu_open.addSeparator() @@ -5164,6 +5168,28 @@ class FlatCAMSystemTray(QtWidgets.QSystemTrayIcon): exitAction.triggered.connect(self.app.final_save) +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): + """ + Class that makes a custom grid layout + + :param parent: + """ + + super().__init__(*args, parent=parent) + + if h_spacing is not None: + self.setHorizontalSpacing(h_spacing) + if v_spacing is not None: + self.setVerticalSpacing(v_spacing) + if margins is not None: + self.setContentsMargins(margins[0], margins[1], margins[2], margins[3]) + + def message_dialog(title, message, kind="info", parent=None): """ Builds and show a custom QMessageBox to be used in FlatCAM. diff --git a/appGUI/ObjectUI.py b/appGUI/ObjectUI.py index 96654f95..fdf53cea 100644 --- a/appGUI/ObjectUI.py +++ b/appGUI/ObjectUI.py @@ -86,7 +86,7 @@ class ObjectUI(QtWidgets.QWidget): # ## Common to all objects ## # ########################### if common is True: - self.common_grid = QtWidgets.QGridLayout() + self.common_grid = FCGridLayout(v_spacing=3) self.common_grid.setColumnStretch(0, 1) self.common_grid.setColumnStretch(1, 0) layout.addLayout(self.common_grid) @@ -178,7 +178,7 @@ class GerberObjectUI(ObjectUI): ObjectUI.__init__(self, title=_('Gerber Object'), parent=parent, app=self.app) # Plot options - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) self.custom_box.addLayout(grid0) grid0.setColumnStretch(0, 0) @@ -425,7 +425,7 @@ class GerberObjectUI(ObjectUI): self.util_frame.setLayout(self.util_box) self.util_frame.hide() - util_grid = QtWidgets.QGridLayout() + util_grid = FCGridLayout(v_spacing=3) util_grid.setColumnStretch(0, 0) util_grid.setColumnStretch(1, 1) self.util_box.addLayout(util_grid) @@ -540,7 +540,7 @@ class ExcellonObjectUI(ObjectUI): parent=parent, app=self.app) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) @@ -706,7 +706,7 @@ class ExcellonObjectUI(ObjectUI): # ########## TOOLS GRID ########################################### # ################################################################# - grid2 = QtWidgets.QGridLayout() + grid2 = FCGridLayout(v_spacing=3) grid2.setColumnStretch(0, 0) grid2.setColumnStretch(1, 1) grid0.addLayout(grid2, 12, 0, 1, 3) @@ -773,7 +773,7 @@ class ExcellonObjectUI(ObjectUI): self.util_frame.setLayout(self.util_box) self.util_frame.hide() - util_grid = QtWidgets.QGridLayout() + util_grid = FCGridLayout(v_spacing=3) util_grid.setColumnStretch(0, 0) util_grid.setColumnStretch(1, 1) self.util_box.addLayout(util_grid) @@ -868,7 +868,7 @@ class GeometryObjectUI(ObjectUI): ) # Plot options - grid_header = QtWidgets.QGridLayout() + grid_header = FCGridLayout(v_spacing=3) grid_header.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) self.custom_box.addLayout(grid_header) grid_header.setColumnStretch(0, 0) @@ -958,7 +958,7 @@ class GeometryObjectUI(ObjectUI): self.geo_table_box.setContentsMargins(0, 0, 0, 0) self.geo_table_frame.setLayout(self.geo_table_box) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.geo_table_box.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) @@ -1029,7 +1029,7 @@ class GeometryObjectUI(ObjectUI): _("Plot column. It is visible only for MultiGeo Geometry objects.\n" "Enable plot for the selected tool geometry.")) - self.grid4 = QtWidgets.QGridLayout() + self.grid4 = FCGridLayout(v_spacing=3) self.grid4.setColumnStretch(0, 0) self.grid4.setColumnStretch(1, 1) self.geo_tools_box.addLayout(self.grid4) @@ -1109,7 +1109,7 @@ class GeometryObjectUI(ObjectUI): self.util_frame.setLayout(self.util_box) self.util_frame.hide() - util_grid = QtWidgets.QGridLayout() + util_grid = FCGridLayout(v_spacing=3) util_grid.setColumnStretch(0, 0) util_grid.setColumnStretch(1, 1) self.util_box.addLayout(util_grid) @@ -1209,7 +1209,7 @@ class CNCObjectUI(ObjectUI): for i in range(0, self.common_grid.count()): self.common_grid.itemAt(i).widget().hide() - f_lay = QtWidgets.QGridLayout() + f_lay = FCGridLayout(v_spacing=3) f_lay.setColumnStretch(0, 0) f_lay.setColumnStretch(1, 1) self.custom_box.addLayout(f_lay) @@ -1599,7 +1599,7 @@ class DocumentObjectUI(ObjectUI): # ############ Grid LAYOUT ##################################### # ############################################################## - self.grid0 = QtWidgets.QGridLayout() + self.grid0 = FCGridLayout(v_spacing=3) self.grid0.setColumnStretch(0, 0) self.grid0.setColumnStretch(1, 1) self.grid0.setColumnStretch(2, 0) diff --git a/appGUI/preferences/OptionUI.py b/appGUI/preferences/OptionUI.py index e9a99467..7975ac86 100644 --- a/appGUI/preferences/OptionUI.py +++ b/appGUI/preferences/OptionUI.py @@ -4,7 +4,7 @@ from PyQt6 import QtWidgets, QtGui from PyQt6.QtCore import QSettings from appGUI.GUIElements import RadioSet, FCCheckBox, FCButton, FCComboBox, FCEntry, FCSpinner, FCColorEntry, \ - FCSliderWithSpinner, FCDoubleSpinner, FloatEntry, FCTextArea, FCLabel + FCSliderWithSpinner, FCDoubleSpinner, FloatEntry, FCTextArea, FCLabel, FCGridLayout import gettext import appTranslation as fcTranslate diff --git a/appGUI/preferences/OptionsGroupUI.py b/appGUI/preferences/OptionsGroupUI.py index 9e03f7c2..fa37026c 100644 --- a/appGUI/preferences/OptionsGroupUI.py +++ b/appGUI/preferences/OptionsGroupUI.py @@ -14,6 +14,7 @@ import appTranslation as fcTranslate import builtins from appGUI.preferences.OptionUI import OptionUI +from appGUI.GUIElements import FCGridLayout fcTranslate.apply_language('strings') if '_' not in builtins.__dict__: @@ -47,7 +48,7 @@ class OptionsGroupUI2(OptionsGroupUI): def __init__(self, **kwargs): super().__init__(**kwargs) - self.grid = QtWidgets.QGridLayout() + self.grid = FCGridLayout(v_spacing=3) self.layout.addLayout(self.grid) self.grid.setColumnStretch(0, 0) self.grid.setColumnStretch(1, 1) diff --git a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py index 8f6c04aa..a652cd17 100644 --- a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCComboBox, FCSpinner, FCColorEntry, FCLabel, FCDoubleSpinner, RadioSet +from appGUI.GUIElements import FCComboBox, FCSpinner, FCColorEntry, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -19,7 +19,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): self.setTitle(str(_("CNC Job Adv. Options"))) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py index 3434b0db..12f71abe 100644 --- a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt6 import QtWidgets from appGUI.GUIElements import FCCheckBox, RadioSet, FCSpinner, FCDoubleSpinner, FCSliderWithSpinner, FCColorEntry, \ - FCLabel + FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -24,7 +24,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): self.plot_options_label = FCLabel("%s:" % _("Plot Options")) self.layout.addWidget(self.plot_options_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) diff --git a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py index c8dda552..30ea69b1 100644 --- a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt6 import QtWidgets, QtGui from PyQt6.QtCore import QSettings -from appGUI.GUIElements import RadioSet, FCCheckBox, FCLabel +from appGUI.GUIElements import RadioSet, FCCheckBox, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -37,7 +37,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI): font = QtGui.QFont() font.setPointSize(tb_fsize) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) diff --git a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py index c31f6044..e7c846fe 100644 --- a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCCheckBox, FCLabel +from appGUI.GUIElements import FCCheckBox, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -32,7 +32,7 @@ class ExcellonAdvOptPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.exc_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py index d04d6fee..616767a6 100644 --- a/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCLabel +from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -26,7 +26,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.param_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) # Selection Limit diff --git a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py index eef029d8..a5be02a9 100644 --- a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets, QtCore -from appGUI.GUIElements import RadioSet, FCSpinner, FCLabel +from appGUI.GUIElements import RadioSet, FCSpinner, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -27,7 +27,7 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.export_options_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py index c3368e32..349bb63e 100644 --- a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py @@ -2,7 +2,7 @@ import platform from PyQt6 import QtWidgets, QtCore -from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCSliderWithSpinner, FCColorEntry, FCLabel +from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCSliderWithSpinner, FCColorEntry, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -26,7 +26,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): self.plot_options_label = FCLabel("%s:" % _("Plot Options")) self.layout.addWidget(self.plot_options_label) - grid1 = QtWidgets.QGridLayout() + grid1 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid1) # Plot CB @@ -55,7 +55,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) grid1.addWidget(separator_line, 1, 0, 1, 3) - grid2 = QtWidgets.QGridLayout() + grid2 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid2) grid2.setColumnStretch(0, 0) grid2.setColumnStretch(1, 1) diff --git a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py index 6b71d3b7..f0d03b1e 100644 --- a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCDoubleSpinner, FCLabel +from appGUI.GUIElements import FCDoubleSpinner, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -28,7 +28,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.cncjob_label) - grid2 = QtWidgets.QGridLayout() + grid2 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid2) grid2.setColumnStretch(0, 0) grid2.setColumnStretch(1, 1) diff --git a/appGUI/preferences/general/GeneralAPPSetGroupUI.py b/appGUI/preferences/general/GeneralAPPSetGroupUI.py index e1715577..dbcd55b3 100644 --- a/appGUI/preferences/general/GeneralAPPSetGroupUI.py +++ b/appGUI/preferences/general/GeneralAPPSetGroupUI.py @@ -2,7 +2,7 @@ from PyQt6 import QtCore, QtWidgets from PyQt6.QtCore import QSettings from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, RadioSet, OptionalInputSection, FCSpinner, \ - FCColorEntry, FCLabel + FCColorEntry, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -33,7 +33,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): self.resource_loc = 'assets/resources' # Create a grid layout for the Application general settings - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) diff --git a/appGUI/preferences/general/GeneralAppPrefGroupUI.py b/appGUI/preferences/general/GeneralAppPrefGroupUI.py index 9baa35aa..805fe389 100644 --- a/appGUI/preferences/general/GeneralAppPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralAppPrefGroupUI.py @@ -4,7 +4,7 @@ from PyQt6 import QtWidgets from PyQt6.QtCore import QSettings from appGUI.GUIElements import RadioSet, FCSpinner, FCCheckBox, FCComboBox, FCButton, OptionalInputSection, \ - FCDoubleSpinner, FCLabel + FCDoubleSpinner, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -24,7 +24,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): self.decimals = decimals # Create a form layout for the Application general settings - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index eb761f19..a5cbc917 100644 --- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -1,7 +1,8 @@ from PyQt6 import QtWidgets, QtCore from PyQt6.QtCore import QSettings -from appGUI.GUIElements import RadioSet, FCCheckBox, FCComboBox, FCSliderWithSpinner, FCColorEntry, FCLabel +from appGUI.GUIElements import RadioSet, FCCheckBox, FCComboBox, FCSliderWithSpinner, FCColorEntry, FCLabel, \ + FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -21,7 +22,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): self.decimals = decimals # Create a grid layout for the Application general settings - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) diff --git a/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py index ddcf1430..1785979d 100644 --- a/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt6 import QtWidgets from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCLabel, NumericalEvalTupleEntry, \ - NumericalEvalEntry, FCComboBox2 + NumericalEvalEntry, FCComboBox2, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -32,7 +32,7 @@ class GeometryAdvOptPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.geo_label) - grid1 = QtWidgets.QGridLayout() + grid1 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid1) # Size of trace segment on X axis diff --git a/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py index 366a988f..8fe11483 100644 --- a/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCSpinner, RadioSet, FCLabel +from appGUI.GUIElements import FCSpinner, RadioSet, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -27,7 +27,7 @@ class GeometryEditorPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.param_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) # Selection Limit diff --git a/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py b/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py index 007259bf..d9239c99 100644 --- a/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets, QtCore -from appGUI.GUIElements import FCLabel, FCComboBox +from appGUI.GUIElements import FCLabel, FCComboBox, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -27,7 +27,7 @@ class GeometryExpPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.export_options_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py index 0b19db0e..437c2d49 100644 --- a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCCheckBox, FCSpinner, FCEntry, FCColorEntry, RadioSet, FCLabel +from appGUI.GUIElements import FCCheckBox, FCSpinner, FCEntry, FCColorEntry, RadioSet, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import platform @@ -43,7 +43,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): ) plot_hlay.addWidget(self.multicolored_cb) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) diff --git a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py index 20921549..c7fa3cdf 100644 --- a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py @@ -2,7 +2,7 @@ from PyQt6 import QtWidgets from PyQt6.QtCore import Qt from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, OptionalInputSection, FCSpinner, FCComboBox, \ - NumericalEvalTupleEntry, FCLabel + NumericalEvalTupleEntry, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -33,7 +33,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.cncjob_label) - grid1 = QtWidgets.QGridLayout() + grid1 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid1) grid1.setColumnStretch(0, 0) grid1.setColumnStretch(1, 1) diff --git a/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py b/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py index cf236246..4b7074d0 100644 --- a/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCLabel, OptionalInputSection +from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCLabel, OptionalInputSection, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -29,7 +29,7 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.adv_param_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) # Follow Attribute diff --git a/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py index c599bcc4..19d8e83f 100644 --- a/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py @@ -1,6 +1,7 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, FCComboBox, FCLabel, RadioSet, NumericalEvalTupleEntry +from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, FCComboBox, FCLabel, RadioSet, NumericalEvalTupleEntry, \ + FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -27,7 +28,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.param_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) # Selection Limit diff --git a/appGUI/preferences/gerber/GerberExpPrefGroupUI.py b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py index 9ee4cae0..40620970 100644 --- a/appGUI/preferences/gerber/GerberExpPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets, QtCore -from appGUI.GUIElements import RadioSet, FCSpinner, FCLabel +from appGUI.GUIElements import RadioSet, FCSpinner, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class GerberExpPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.export_options_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appGUI/preferences/gerber/GerberGenPrefGroupUI.py b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py index d057963a..888ab6f1 100644 --- a/appGUI/preferences/gerber/GerberGenPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py @@ -1,6 +1,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui -from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCButton, FCSliderWithSpinner, FCColorEntry, FCLabel +from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCButton, FCSliderWithSpinner, FCColorEntry, FCLabel, \ + FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -24,7 +25,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI): self.plot_options_label = FCLabel("%s:" % _("Plot Options")) self.layout.addWidget(self.plot_options_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) # Plot CB diff --git a/appGUI/preferences/gerber/GerberOptPrefGroupUI.py b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py index 8d858eaf..421f507e 100644 --- a/appGUI/preferences/gerber/GerberOptPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCLabel +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -32,7 +32,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.clearcopper_label) - grid1 = QtWidgets.QGridLayout() + grid1 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid1) # Margin @@ -66,7 +66,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI): self.boundingbox_label = FCLabel('%s:' % _('Bounding Box')) self.layout.addWidget(self.boundingbox_label) - grid2 = QtWidgets.QGridLayout() + grid2 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid2) bbmargin = FCLabel('%s:' % _('Boundary Margin')) diff --git a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py index f5099856..526fc125 100644 --- a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCLabel, FCCheckBox +from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCLabel, FCCheckBox, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -21,7 +21,7 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) diff --git a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py index f6c9b9f8..7ad48667 100644 --- a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCLabel +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -21,7 +21,7 @@ class Tools2CalPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) diff --git a/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py b/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py index 565bee5c..49f55658 100644 --- a/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCLabel +from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -21,7 +21,7 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) diff --git a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py index 37c2f5ee..5e6de6f8 100644 --- a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel +from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -21,7 +21,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) diff --git a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py index 406bb9d4..84a5e178 100644 --- a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel +from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -29,7 +29,7 @@ class Tools2InvertPrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.sublabel) # Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py index cefe76b8..8f7decf6 100644 --- a/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCSpinner, FCLabel +from appGUI.GUIElements import FCSpinner, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class Tools2OptimalPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.optlabel) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) diff --git a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py index ec502f86..7408eeec 100644 --- a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCLabel +from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -21,7 +21,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) diff --git a/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py index 01710bdd..1ccc6ebb 100644 --- a/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCSpinner, RadioSet, FCTextArea, FCLabel, FCColorEntry +from appGUI.GUIElements import FCSpinner, RadioSet, FCTextArea, FCLabel, FCColorEntry, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -29,7 +29,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.qrlabel) # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) diff --git a/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py index dac3acca..f161ee0e 100644 --- a/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, FCLabel +from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.crlabel) # Form Layout - self.grid0 = QtWidgets.QGridLayout() + self.grid0 = FCGridLayout(v_spacing=3) self.grid0.setColumnStretch(0, 0) self.grid0.setColumnStretch(1, 1) self.layout.addLayout(self.grid0) diff --git a/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py index 6480c26a..9ea1e41e 100644 --- a/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel +from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.dblsided_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) # ## Drill diameter for alignment holes diff --git a/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py b/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py index 9776a0d1..73330afc 100644 --- a/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCDoubleSpinner, FCLabel +from appGUI.GUIElements import FCDoubleSpinner, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -29,7 +29,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.vshape_tool_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appGUI/preferences/tools/ToolsCornersPrefGroupUI.py b/appGUI/preferences/tools/ToolsCornersPrefGroupUI.py index eb8bce04..2062b5ad 100644 --- a/appGUI/preferences/tools/ToolsCornersPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsCornersPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCDoubleSpinner, FCLabel, RadioSet +from appGUI.GUIElements import FCDoubleSpinner, FCLabel, RadioSet, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -20,7 +20,7 @@ class ToolsCornersPrefGroupUI(OptionsGroupUI): self.setTitle(str(_("Corner Markers Options"))) self.decimals = decimals - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py b/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py index 4a6ae46f..c3058e83 100644 --- a/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py @@ -1,6 +1,7 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox, FCLabel, OptionalInputSection +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox, FCLabel, OptionalInputSection, \ + FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -29,7 +30,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.board_cutout_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) tdclabel = FCLabel('%s:' % _('Tool Diameter')) diff --git a/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py b/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py index d54c5ab3..7f26bea0 100644 --- a/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py @@ -2,7 +2,7 @@ from PyQt6 import QtWidgets from PyQt6.QtCore import Qt from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, FCSpinner, NumericalEvalTupleEntry, \ - OptionalInputSection, NumericalEvalEntry, FCLabel + OptionalInputSection, NumericalEvalEntry, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.drill_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) # Tool order Radio Button diff --git a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py index 91ca16c9..87843653 100644 --- a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py @@ -1,6 +1,7 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCComboBox, FCColorEntry, FCLabel, FCSpinner +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCComboBox, FCColorEntry, FCLabel, FCSpinner, \ + FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +29,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.film_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) self.film_type_radio = RadioSet([{'label': 'Pos', 'value': 'pos'}, diff --git a/appGUI/preferences/tools/ToolsISOPrefGroupUI.py b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py index 64fd6ccc..35e31b53 100644 --- a/appGUI/preferences/tools/ToolsISOPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt6 import QtWidgets from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox2, FCCheckBox, FCSpinner, NumericalEvalTupleEntry, \ - FCLabel + FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.iso_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) # Tool Dias diff --git a/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py b/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py index a18ebd11..be6221f8 100644 --- a/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCLabel, FCComboBox +from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCLabel, FCComboBox, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.levelling_label) # Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appGUI/preferences/tools/ToolsMillPrefGroupUI.py b/appGUI/preferences/tools/ToolsMillPrefGroupUI.py index 0664dc0b..8b781c21 100644 --- a/appGUI/preferences/tools/ToolsMillPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsMillPrefGroupUI.py @@ -2,7 +2,7 @@ from PyQt6 import QtWidgets from PyQt6.QtCore import Qt from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, FCSpinner, NumericalEvalTupleEntry, \ - OptionalInputSection, NumericalEvalEntry, FCLabel, FCComboBox2, FCEntry + OptionalInputSection, NumericalEvalEntry, FCLabel, FCComboBox2, FCEntry, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.mill_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) # Tooldia diff --git a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py index 427af55d..e9ef2c83 100644 --- a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py @@ -1,6 +1,7 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCComboBox2, FCLabel +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCComboBox2, FCLabel, \ + FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +29,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.clearcopper_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) ncctdlabel = FCLabel('%s:' % _('Tools Dia')) diff --git a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py index 7ba03e19..7876733c 100644 --- a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py @@ -1,6 +1,7 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox2, FCCheckBox, NumericalEvalTupleEntry, FCLabel +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox2, FCCheckBox, NumericalEvalTupleEntry, FCLabel, \ + FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -30,7 +31,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.paint_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py index d53ae0b5..915c2f5b 100644 --- a/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox, FCLabel +from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -29,7 +29,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.panelize_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) diff --git a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py index 077bac79..f1e5c410 100644 --- a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, FCComboBox, NumericalEvalTupleEntry, FCLabel +from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, FCComboBox, NumericalEvalTupleEntry, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.solderpastelabel) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) # Nozzle Tool Diameters diff --git a/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py index ba3200b7..8747aa4c 100644 --- a/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets, QtGui -from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCComboBox, FCLabel +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCComboBox, FCLabel, FCGridLayout from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): ) self.layout.addWidget(self.transform_label) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) diff --git a/appPlugins/ToolAlignObjects.py b/appPlugins/ToolAlignObjects.py index f703a3c0..68618093 100644 --- a/appPlugins/ToolAlignObjects.py +++ b/appPlugins/ToolAlignObjects.py @@ -8,7 +8,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool -from appGUI.GUIElements import FCComboBox, RadioSet, FCLabel, FCButton, VerticalScrollArea +from appGUI.GUIElements import FCComboBox, RadioSet, FCLabel, FCButton, VerticalScrollArea, FCGridLayout import math @@ -414,7 +414,7 @@ class AlignUI: self.layout.addWidget(QtWidgets.QLabel("")) # Form Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appPlugins/ToolCalculators.py b/appPlugins/ToolCalculators.py index d8fe0d3e..fd9d27c6 100644 --- a/appPlugins/ToolCalculators.py +++ b/appPlugins/ToolCalculators.py @@ -8,7 +8,7 @@ from PyQt6 import QtWidgets, QtGui from appTool import AppTool from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, NumericalEvalEntry, FCLabel, RadioSet, FCButton, \ - VerticalScrollArea + VerticalScrollArea, FCGridLayout import math import gettext @@ -445,7 +445,7 @@ class CalcUI: self.layout.addWidget(units_label) # Grid Layout - grid_units_layout = QtWidgets.QGridLayout() + grid_units_layout = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_units_layout) inch_label = FCLabel(_("INCH")) @@ -470,7 +470,7 @@ class CalcUI: # ############################################################################################################# # ################################ V-shape Tool Calculator #################################################### # ############################################################################################################# - grid_vshape = QtWidgets.QGridLayout() + grid_vshape = FCGridLayout(v_spacing=3) grid_vshape.setColumnStretch(0, 0) grid_vshape.setColumnStretch(1, 1) self.layout.addLayout(grid_vshape) @@ -546,9 +546,10 @@ class CalcUI: # ############################################################################################################# # ############################## ElectroPlating Tool Calculator ############################################### # ############################################################################################################# - grid_electro = QtWidgets.QGridLayout() + grid_electro = FCGridLayout(v_spacing=3) grid_electro.setColumnStretch(0, 0) grid_electro.setColumnStretch(1, 1) + self.layout.addLayout(grid_electro) grid_electro.addWidget(FCLabel(""), 0, 0, 1, 2) diff --git a/appPlugins/ToolCalibration.py b/appPlugins/ToolCalibration.py index e350fc60..93c1f5cc 100644 --- a/appPlugins/ToolCalibration.py +++ b/appPlugins/ToolCalibration.py @@ -9,7 +9,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool from appGUI.GUIElements import FCDoubleSpinner, EvalEntry, FCCheckBox, OptionalInputSection, FCEntry, VerticalScrollArea -from appGUI.GUIElements import FCTable, FCComboBox, RadioSet +from appGUI.GUIElements import FCTable, FCComboBox, RadioSet, FCGridLayout from appEditors.AppTextEditor import AppTextEditor from shapely.geometry import Point @@ -783,7 +783,7 @@ class CalibrationUI: self.layout.addWidget(QtWidgets.QLabel("")) # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) diff --git a/appPlugins/ToolCopperThieving.py b/appPlugins/ToolCopperThieving.py index cadaf553..99620926 100644 --- a/appPlugins/ToolCopperThieving.py +++ b/appPlugins/ToolCopperThieving.py @@ -9,7 +9,8 @@ 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 +from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCEntry, FCComboBox, FCLabel, FCCheckBox, \ + VerticalScrollArea, FCGridLayout from appCommon.Common import LoudDict import shapely.geometry.base as base @@ -1287,7 +1288,7 @@ class ThievingUI: self.layout.addWidget(FCLabel("")) # ## Grid Layout - i_grid_lay = QtWidgets.QGridLayout() + i_grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(i_grid_lay) i_grid_lay.setColumnStretch(0, 0) i_grid_lay.setColumnStretch(1, 1) @@ -1312,7 +1313,7 @@ class ThievingUI: i_grid_lay.addWidget(separator_line, 2, 0, 1, 2) # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) @@ -1463,7 +1464,7 @@ class ThievingUI: self.dots_frame = QtWidgets.QFrame() self.dots_frame.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.dots_frame) - dots_grid = QtWidgets.QGridLayout() + dots_grid = FCGridLayout(v_spacing=3) dots_grid.setColumnStretch(0, 0) dots_grid.setColumnStretch(1, 1) dots_grid.setContentsMargins(0, 0, 0, 0) @@ -1503,7 +1504,7 @@ class ThievingUI: self.squares_frame = QtWidgets.QFrame() self.squares_frame.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.squares_frame) - squares_grid = QtWidgets.QGridLayout() + squares_grid = FCGridLayout(v_spacing=3) squares_grid.setColumnStretch(0, 0) squares_grid.setColumnStretch(1, 1) squares_grid.setContentsMargins(0, 0, 0, 0) @@ -1543,7 +1544,7 @@ class ThievingUI: self.lines_frame = QtWidgets.QFrame() self.lines_frame.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.lines_frame) - lines_grid = QtWidgets.QGridLayout() + lines_grid = FCGridLayout(v_spacing=3) lines_grid.setColumnStretch(0, 0) lines_grid.setColumnStretch(1, 1) lines_grid.setContentsMargins(0, 0, 0, 0) @@ -1595,7 +1596,7 @@ class ThievingUI: self.layout.addWidget(self.fill_button) # ## Grid Layout - grid_lay_1 = QtWidgets.QGridLayout() + grid_lay_1 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay_1) grid_lay_1.setColumnStretch(0, 0) grid_lay_1.setColumnStretch(1, 1) diff --git a/appPlugins/ToolCorners.py b/appPlugins/ToolCorners.py index d869d286..e97170c3 100644 --- a/appPlugins/ToolCorners.py +++ b/appPlugins/ToolCorners.py @@ -9,7 +9,8 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool from appCommon.Common import LoudDict -from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, FCButton, RadioSet, FCLabel, VerticalScrollArea +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, FCButton, RadioSet, FCLabel, \ + VerticalScrollArea, FCGridLayout from shapely.geometry import MultiPolygon, LineString, Point from shapely.ops import unary_union @@ -724,7 +725,7 @@ class CornersUI: self.layout.addWidget(self.points_label) # ## Grid Layout - grid_loc = QtWidgets.QGridLayout() + grid_loc = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_loc) # TOP LEFT @@ -758,7 +759,7 @@ class CornersUI: self.layout.addWidget(separator_line) # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) diff --git a/appPlugins/ToolCutOut.py b/appPlugins/ToolCutOut.py index 40ec27c3..23357498 100644 --- a/appPlugins/ToolCutOut.py +++ b/appPlugins/ToolCutOut.py @@ -8,7 +8,7 @@ from PyQt6 import QtWidgets, QtGui, QtCore from appTool import AppTool from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox, OptionalInputSection, FCButton, \ - FCLabel, VerticalScrollArea + FCLabel, VerticalScrollArea, FCGridLayout from shapely.geometry import box, MultiPolygon, Polygon, LineString, LinearRing, MultiLineString, Point from shapely.ops import unary_union, linemerge @@ -2332,7 +2332,7 @@ class CutoutUI: # self.tools_box.addWidget(FCLabel('')) # Form Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) diff --git a/appPlugins/ToolDblSided.py b/appPlugins/ToolDblSided.py index 6d8243d9..c77621e7 100644 --- a/appPlugins/ToolDblSided.py +++ b/appPlugins/ToolDblSided.py @@ -3,7 +3,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCButton, FCComboBox, NumericalEvalTupleEntry, FCLabel, \ - VerticalScrollArea + VerticalScrollArea, FCGridLayout from numpy import Inf from copy import deepcopy @@ -682,7 +682,7 @@ class DsidedUI: self.title_box.addWidget(self.level) # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) grid_lay.setColumnStretch(0, 1) grid_lay.setColumnStretch(1, 0) self.tools_box.addLayout(grid_lay) @@ -724,7 +724,7 @@ class DsidedUI: # ############################################################################################################# # ########## BOUNDS OPERATION ########################################################################### # ############################################################################################################# - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) @@ -830,7 +830,7 @@ class DsidedUI: # ############################################################################################################# # ########## MIRROR OPERATION ########################################################################### # ############################################################################################################# - grid1 = QtWidgets.QGridLayout() + grid1 = FCGridLayout(v_spacing=3) grid1.setColumnStretch(0, 0) grid1.setColumnStretch(1, 1) self.tools_box.addLayout(grid1) @@ -928,7 +928,7 @@ class DsidedUI: grid1.addWidget(self.pick_hole_button, 12, 0, 1, 3) # ## Grid Layout - grid_lay3 = QtWidgets.QGridLayout() + grid_lay3 = FCGridLayout(v_spacing=3) grid_lay3.setColumnStretch(0, 0) grid_lay3.setColumnStretch(1, 1) grid1.addLayout(grid_lay3, 14, 0, 1, 3) @@ -984,7 +984,7 @@ class DsidedUI: # ############################################################################################################# # ########## ALIGNMENT OPERATION ######################################################################## # ############################################################################################################# - grid4 = QtWidgets.QGridLayout() + grid4 = FCGridLayout(v_spacing=3) grid4.setColumnStretch(0, 0) grid4.setColumnStretch(1, 1) self.tools_box.addLayout(grid4) @@ -1050,7 +1050,7 @@ class DsidedUI: grid4.addWidget(self.align_ref_label, 6, 0) grid4.addWidget(self.align_ref_label_val, 6, 1) - grid5 = QtWidgets.QGridLayout() + grid5 = FCGridLayout(v_spacing=3) self.tools_box.addLayout(grid5) # ## Alignment holes diff --git a/appPlugins/ToolDistance.py b/appPlugins/ToolDistance.py index 45f22993..ff8c83a1 100644 --- a/appPlugins/ToolDistance.py +++ b/appPlugins/ToolDistance.py @@ -9,7 +9,7 @@ from PyQt6 import QtWidgets, QtCore from appTool import AppTool from appGUI.VisPyVisuals import * -from appGUI.GUIElements import FCEntry, FCButton, FCCheckBox, FCLabel, VerticalScrollArea +from appGUI.GUIElements import FCEntry, FCButton, FCCheckBox, FCLabel, VerticalScrollArea, FCGridLayout from shapely.geometry import Point, MultiLineString, Polygon @@ -577,7 +577,7 @@ class DistUI: self.layout.addWidget(title_label) # ## Form Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appPlugins/ToolDistanceMin.py b/appPlugins/ToolDistanceMin.py index b1d7408c..79508c43 100644 --- a/appPlugins/ToolDistanceMin.py +++ b/appPlugins/ToolDistanceMin.py @@ -7,7 +7,7 @@ from PyQt6 import QtWidgets, QtCore from appTool import AppTool -from appGUI.GUIElements import FCEntry, FCLabel, FCButton, VerticalScrollArea +from appGUI.GUIElements import FCEntry, FCLabel, FCButton, VerticalScrollArea, FCGridLayout from shapely.ops import nearest_points from shapely.geometry import Point, MultiPolygon @@ -253,7 +253,7 @@ class DistMinUI: self.layout.addWidget(title_label) # ## Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appPlugins/ToolDrilling.py b/appPlugins/ToolDrilling.py index 3794288e..683a732b 100644 --- a/appPlugins/ToolDrilling.py +++ b/appPlugins/ToolDrilling.py @@ -10,7 +10,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCButton, \ FCComboBox, OptionalInputSection, FCSpinner, NumericalEvalEntry, OptionalHideInputSection, FCLabel, \ - NumericalEvalTupleEntry, FCComboBox2, VerticalScrollArea + NumericalEvalTupleEntry, FCComboBox2, VerticalScrollArea, FCGridLayout from appParsers.ParseExcellon import Excellon from copy import deepcopy @@ -2292,7 +2292,7 @@ class DrillingUI: self.title_box.addWidget(self.level) # Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) @@ -2402,7 +2402,7 @@ class DrillingUI: # ################# GRID LAYOUT 3 ############################### # ################################################################# - self.grid1 = QtWidgets.QGridLayout() + self.grid1 = FCGridLayout(v_spacing=3) self.grid1.setColumnStretch(0, 0) self.grid1.setColumnStretch(1, 1) self.exc_tools_box.addLayout(self.grid1) @@ -2611,7 +2611,7 @@ class DrillingUI: # ################################################################# # ################# COMMON PARAMETERS ############################# - self.grid3 = QtWidgets.QGridLayout() + self.grid3 = FCGridLayout(v_spacing=3) self.grid3.setColumnStretch(0, 0) self.grid3.setColumnStretch(1, 1) self.exc_tools_box.addLayout(self.grid3) @@ -2817,7 +2817,7 @@ class DrillingUI: self.exclusion_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) - grid_a1 = QtWidgets.QGridLayout() + grid_a1 = FCGridLayout(v_spacing=3) grid_a1.setColumnStretch(0, 0) grid_a1.setColumnStretch(1, 1) self.exclusion_box.addLayout(grid_a1) @@ -2888,7 +2888,7 @@ class DrillingUI: # ################################################################# # ################# GRID LAYOUT 6 ############################### # ################################################################# - self.grid4 = QtWidgets.QGridLayout() + self.grid4 = FCGridLayout(v_spacing=3) self.grid4.setColumnStretch(0, 0) self.grid4.setColumnStretch(1, 1) self.tools_box.addLayout(self.grid4) diff --git a/appPlugins/ToolEtchCompensation.py b/appPlugins/ToolEtchCompensation.py index a21ccc5b..f0555db9 100644 --- a/appPlugins/ToolEtchCompensation.py +++ b/appPlugins/ToolEtchCompensation.py @@ -9,7 +9,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool from appGUI.GUIElements import FCButton, FCDoubleSpinner, RadioSet, FCComboBox, NumericalEvalEntry, FCEntry, \ - VerticalScrollArea + VerticalScrollArea, FCGridLayout from shapely.ops import unary_union @@ -328,7 +328,7 @@ class EtchUI: self.tools_box.addWidget(title_label) # Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) diff --git a/appPlugins/ToolExtract.py b/appPlugins/ToolExtract.py index 48c0764a..327ed213 100644 --- a/appPlugins/ToolExtract.py +++ b/appPlugins/ToolExtract.py @@ -8,7 +8,8 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool -from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCComboBox, FCLabel, FCTable, VerticalScrollArea +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCComboBox, FCLabel, FCTable, \ + VerticalScrollArea, FCGridLayout from shapely.geometry import Point, MultiPolygon, Polygon, box @@ -915,7 +916,7 @@ class ExtractUI: self.layout.addWidget(FCLabel("")) # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 1) grid_lay.setColumnStretch(1, 0) @@ -943,12 +944,12 @@ class ExtractUI: grid_lay.addWidget(self.padt_label, 4, 0, 1, 2) - pad_all_grid = QtWidgets.QGridLayout() + pad_all_grid = FCGridLayout(v_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 = QtWidgets.QGridLayout() + pad_grid = FCGridLayout(v_spacing=3) pad_grid.setColumnStretch(0, 0) pad_all_grid.addLayout(pad_grid, 0, 0) @@ -1030,7 +1031,7 @@ class ExtractUI: grid_lay.addWidget(separator_line, 20, 0, 1, 2) # ## Grid Layout - grid1 = QtWidgets.QGridLayout() + grid1 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid1) grid1.setColumnStretch(0, 0) grid1.setColumnStretch(1, 1) @@ -1078,7 +1079,7 @@ class ExtractUI: self.ring_frame.setLayout(self.ring_box) # ## Grid Layout - grid2 = QtWidgets.QGridLayout() + grid2 = FCGridLayout(v_spacing=3) grid2.setColumnStretch(0, 0) grid2.setColumnStretch(1, 1) self.ring_box.addLayout(grid2) @@ -1157,7 +1158,7 @@ class ExtractUI: grid2.addWidget(self.other_ring_label, 5, 0) grid2.addWidget(self.other_ring_entry, 5, 1) - grid3 = QtWidgets.QGridLayout() + grid3 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid3) grid3.setColumnStretch(0, 0) grid3.setColumnStretch(1, 1) diff --git a/appPlugins/ToolFiducials.py b/appPlugins/ToolFiducials.py index 8ce7f032..73323c9b 100644 --- a/appPlugins/ToolFiducials.py +++ b/appPlugins/ToolFiducials.py @@ -9,7 +9,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool from appGUI.GUIElements import FCDoubleSpinner, RadioSet, EvalEntry, FCTable, FCComboBox, FCButton, FCLabel, \ - VerticalScrollArea + VerticalScrollArea, FCGridLayout from appCommon.Common import LoudDict from shapely.geometry import Point, Polygon, MultiPolygon, LineString @@ -895,7 +895,7 @@ class FidoUI: self.layout.addWidget(separator_line) # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) diff --git a/appPlugins/ToolFilm.py b/appPlugins/ToolFilm.py index 943d42c6..636f8cb7 100644 --- a/appPlugins/ToolFilm.py +++ b/appPlugins/ToolFilm.py @@ -9,7 +9,8 @@ from PyQt6 import QtCore, QtWidgets, QtGui from appTool import AppTool from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, \ - OptionalHideInputSection, FCComboBox, FCFileSaveDialog, FCButton, FCLabel, FCSpinner, VerticalScrollArea + OptionalHideInputSection, FCComboBox, FCFileSaveDialog, FCButton, FCLabel, FCSpinner, \ + VerticalScrollArea, FCGridLayout from copy import deepcopy import logging @@ -1174,7 +1175,7 @@ class FilmUI: self.title_box.addWidget(self.level) # Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.tools_box.addLayout(grid0) grid0.setColumnStretch(0, 0) @@ -1448,7 +1449,7 @@ class FilmUI: self.punch_frame = QtWidgets.QFrame() self.punch_frame.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.punch_frame) - punch_grid = QtWidgets.QGridLayout() + punch_grid = FCGridLayout(v_spacing=3) punch_grid.setContentsMargins(0, 0, 0, 0) self.punch_frame.setLayout(punch_grid) @@ -1498,7 +1499,7 @@ class FilmUI: self.punch_size_label.hide() self.punch_size_spinner.hide() - self.grid1 = QtWidgets.QGridLayout() + self.grid1 = FCGridLayout(v_spacing=3) self.layout.addLayout(self.grid1) self.grid1.setColumnStretch(0, 0) self.grid1.setColumnStretch(1, 1) diff --git a/appPlugins/ToolFollow.py b/appPlugins/ToolFollow.py index 8fac5a68..4c1d5d7d 100644 --- a/appPlugins/ToolFollow.py +++ b/appPlugins/ToolFollow.py @@ -8,7 +8,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool -from appGUI.GUIElements import RadioSet, FCButton, FCComboBox, FCLabel, VerticalScrollArea +from appGUI.GUIElements import RadioSet, FCButton, FCComboBox, FCLabel, VerticalScrollArea, FCGridLayout from appParsers.ParseGerber import Gerber from copy import deepcopy @@ -734,7 +734,7 @@ class FollowUI: separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) self.tools_box.addWidget(separator_line) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) diff --git a/appPlugins/ToolImage.py b/appPlugins/ToolImage.py index b25b6dcc..ded54b6c 100644 --- a/appPlugins/ToolImage.py +++ b/appPlugins/ToolImage.py @@ -8,7 +8,7 @@ from PyQt6 import QtGui, QtWidgets from appTool import AppTool -from appGUI.GUIElements import RadioSet, FCComboBox, FCSpinner, FCLabel, VerticalScrollArea +from appGUI.GUIElements import RadioSet, FCComboBox, FCSpinner, FCLabel, VerticalScrollArea, FCGridLayout import os @@ -223,7 +223,7 @@ class ImageUI: self.layout.addWidget(title_label) # Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appPlugins/ToolInvertGerber.py b/appPlugins/ToolInvertGerber.py index 2575be8a..40c58ad6 100644 --- a/appPlugins/ToolInvertGerber.py +++ b/appPlugins/ToolInvertGerber.py @@ -8,7 +8,8 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool -from appGUI.GUIElements import FCButton, FCDoubleSpinner, RadioSet, FCComboBox, FCLabel, VerticalScrollArea +from appGUI.GUIElements import FCButton, FCDoubleSpinner, RadioSet, FCComboBox, FCLabel, \ + VerticalScrollArea, FCGridLayout from shapely.geometry import box @@ -239,7 +240,7 @@ class InvertUI: self.tools_frame.setLayout(self.tools_box) # Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) diff --git a/appPlugins/ToolIsolation.py b/appPlugins/ToolIsolation.py index b5a9fabc..37395311 100644 --- a/appPlugins/ToolIsolation.py +++ b/appPlugins/ToolIsolation.py @@ -9,7 +9,8 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCButton, \ - FCComboBox, OptionalInputSection, FCSpinner, FCLabel, FCInputDialogSpinnerButton, FCComboBox2, VerticalScrollArea + FCComboBox, OptionalInputSection, FCSpinner, FCLabel, FCInputDialogSpinnerButton, FCComboBox2, \ + VerticalScrollArea, FCGridLayout from appParsers.ParseGerber import Gerber from camlib import grace @@ -3260,7 +3261,7 @@ class IsoUI: "B = ball tip milling tool\n" "V = v-shape milling tool")) - grid1 = QtWidgets.QGridLayout() + grid1 = FCGridLayout(v_spacing=3) grid1.setColumnStretch(0, 0) grid1.setColumnStretch(1, 1) self.tools_box.addLayout(grid1) @@ -3290,7 +3291,7 @@ class IsoUI: # ############### Tool adding ################################# # ############################################################# - self.grid3 = QtWidgets.QGridLayout() + self.grid3 = FCGridLayout(v_spacing=3) self.grid3.setColumnStretch(0, 0) self.grid3.setColumnStretch(1, 1) self.tools_box.addLayout(self.grid3) @@ -3331,7 +3332,7 @@ class IsoUI: # ############################################################################################################# # ################################ Button Grid ########################################################### # ############################################################################################################# - button_grid = QtWidgets.QGridLayout() + button_grid = FCGridLayout(v_spacing=3) button_grid.setColumnStretch(0, 1) button_grid.setColumnStretch(1, 0) self.grid3.addLayout(button_grid, 7, 0, 1, 2) diff --git a/appPlugins/ToolLevelling.py b/appPlugins/ToolLevelling.py index 21c91772..b6044559 100644 --- a/appPlugins/ToolLevelling.py +++ b/appPlugins/ToolLevelling.py @@ -14,7 +14,7 @@ from appGUI.VisPyVisuals import * from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy from appGUI.GUIElements import RadioSet, FCButton, FCComboBox, FCLabel, FCFileSaveDialog, FCCheckBox, FCTable, \ FCDoubleSpinner, FCSpinner, FCDetachableTab, FCZeroAxes, FCJog, FCSliderWithDoubleSpinner, RotatedToolButton, \ - FCEntry, VerticalScrollArea + FCEntry, VerticalScrollArea, FCGridLayout from appEditors.AppTextEditor import AppTextEditor from camlib import CNCjob @@ -1796,7 +1796,7 @@ class LevelUI: self.al_box.setContentsMargins(0, 0, 0, 0) self.al_frame.setLayout(self.al_box) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.al_box.addLayout(grid0) @@ -2023,7 +2023,7 @@ class LevelUI: # ############################################################################################################# # GRBL CONNECT # ############################################################################################################# - grbl_conn_grid = QtWidgets.QGridLayout() + grbl_conn_grid = FCGridLayout(v_spacing=3) grbl_conn_grid.setColumnStretch(0, 0) grbl_conn_grid.setColumnStretch(1, 1) grbl_conn_grid.setColumnStretch(2, 0) @@ -2104,13 +2104,13 @@ class LevelUI: # ############################################################################################################# # GRBL CONTROL # ############################################################################################################# - grbl_ctrl_grid = QtWidgets.QGridLayout() + grbl_ctrl_grid = FCGridLayout(v_spacing=3) grbl_ctrl_grid.setColumnStretch(0, 0) grbl_ctrl_grid.setColumnStretch(1, 1) grbl_ctrl_grid.setColumnStretch(2, 0) self.gr_ctrl_tab_layout.addLayout(grbl_ctrl_grid) - grbl_ctrl2_grid = QtWidgets.QGridLayout() + grbl_ctrl2_grid = FCGridLayout(v_spacing=3) grbl_ctrl2_grid.setColumnStretch(0, 0) grbl_ctrl2_grid.setColumnStretch(1, 1) self.gr_ctrl_tab_layout.addLayout(grbl_ctrl2_grid) @@ -2210,7 +2210,7 @@ class LevelUI: # ############################################################################################################# # GRBL SENDER # ############################################################################################################# - grbl_send_grid = QtWidgets.QGridLayout() + grbl_send_grid = FCGridLayout(v_spacing=3) grbl_send_grid.setColumnStretch(0, 1) grbl_send_grid.setColumnStretch(1, 0) self.gr_send_tab_layout.addLayout(grbl_send_grid) diff --git a/appPlugins/ToolMilling.py b/appPlugins/ToolMilling.py index fecca725..2d2b864a 100644 --- a/appPlugins/ToolMilling.py +++ b/appPlugins/ToolMilling.py @@ -10,7 +10,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCButton, FCComboBox2, \ FCComboBox, OptionalInputSection, FCSpinner, NumericalEvalTupleEntry, OptionalHideInputSection, FCLabel, \ - VerticalScrollArea + VerticalScrollArea, FCGridLayout from appParsers.ParseExcellon import Excellon from camlib import grace @@ -3571,7 +3571,7 @@ class MillingUI: self.title_box.addWidget(self.level) # Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) @@ -3706,7 +3706,7 @@ class MillingUI: self.add_tool_frame = QtWidgets.QFrame() self.add_tool_frame.setContentsMargins(0, 0, 0, 0) grid0.addWidget(self.add_tool_frame, 14, 0, 1, 2) - grid_tool = QtWidgets.QGridLayout() + grid_tool = FCGridLayout(v_spacing=3) grid_tool.setColumnStretch(0, 0) grid_tool.setColumnStretch(1, 1) grid_tool.setContentsMargins(0, 0, 0, 0) @@ -3731,7 +3731,7 @@ class MillingUI: # ############################################################################################################# # ################################ Button Grid ########################################################### # ############################################################################################################# - button_grid = QtWidgets.QGridLayout() + button_grid = FCGridLayout(v_spacing=3) button_grid.setColumnStretch(0, 1) button_grid.setColumnStretch(1, 0) grid_tool.addLayout(button_grid, 5, 0, 1, 2) @@ -3802,7 +3802,7 @@ class MillingUI: # ################# GRID LAYOUT 3 ############################### # ################################################################# - self.grid1 = QtWidgets.QGridLayout() + self.grid1 = FCGridLayout(v_spacing=3) self.grid1.setColumnStretch(0, 0) self.grid1.setColumnStretch(1, 1) self.exc_tools_box.addLayout(self.grid1) @@ -4230,7 +4230,7 @@ class MillingUI: # ################################################################# # ################# COMMON PARAMETERS ############################# - self.grid3 = QtWidgets.QGridLayout() + self.grid3 = FCGridLayout(v_spacing=3) self.grid3.setColumnStretch(0, 0) self.grid3.setColumnStretch(1, 1) self.exc_tools_box.addLayout(self.grid3) @@ -4426,7 +4426,7 @@ class MillingUI: self.exclusion_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) - grid_a1 = QtWidgets.QGridLayout() + grid_a1 = FCGridLayout(v_spacing=3) grid_a1.setColumnStretch(0, 0) grid_a1.setColumnStretch(1, 1) self.exclusion_box.addLayout(grid_a1) @@ -4497,7 +4497,7 @@ class MillingUI: # ################################################################# # ################# GRID LAYOUT 6 ############################### # ################################################################# - self.grid4 = QtWidgets.QGridLayout() + self.grid4 = FCGridLayout(v_spacing=3) self.grid4.setColumnStretch(0, 0) self.grid4.setColumnStretch(1, 1) self.tools_box.addLayout(self.grid4) diff --git a/appPlugins/ToolNCC.py b/appPlugins/ToolNCC.py index 3091ed3d..23526862 100644 --- a/appPlugins/ToolNCC.py +++ b/appPlugins/ToolNCC.py @@ -9,7 +9,8 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCButton,\ - FCComboBox, OptionalInputSection, FCLabel, FCInputDialogSpinnerButton, FCComboBox2, VerticalScrollArea + FCComboBox, OptionalInputSection, FCLabel, FCInputDialogSpinnerButton, FCComboBox2, \ + VerticalScrollArea, FCGridLayout from appParsers.ParseGerber import Gerber from camlib import grace @@ -4141,7 +4142,7 @@ class NccUI: self.title_box.addWidget(self.level) # ## Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) @@ -4223,7 +4224,7 @@ class NccUI: # "If it's not successful then the non-copper clearing will fail, too.\n" # "- Clear -> the regular non-copper clearing.")) - grid1 = QtWidgets.QGridLayout() + grid1 = FCGridLayout(v_spacing=3) grid1.setColumnStretch(0, 0) grid1.setColumnStretch(1, 1) self.tools_box.addLayout(grid1) @@ -4259,7 +4260,7 @@ class NccUI: # ############### Tool selection ############################## # ############################################################# - self.grid3 = QtWidgets.QGridLayout() + self.grid3 = FCGridLayout(v_spacing=3) self.tools_box.addLayout(self.grid3) self.grid3.setColumnStretch(0, 0) self.grid3.setColumnStretch(1, 1) @@ -4299,7 +4300,7 @@ class NccUI: # ############################################################################################################# # ################################ Button Grid ########################################################### # ############################################################################################################# - button_grid = QtWidgets.QGridLayout() + button_grid = FCGridLayout(v_spacing=3) button_grid.setColumnStretch(0, 1) button_grid.setColumnStretch(1, 0) self.grid3.addLayout(button_grid, 7, 0, 1, 2) diff --git a/appPlugins/ToolOptimal.py b/appPlugins/ToolOptimal.py index 7e0b35bc..dc009ddd 100644 --- a/appPlugins/ToolOptimal.py +++ b/appPlugins/ToolOptimal.py @@ -9,7 +9,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool from appGUI.GUIElements import OptionalHideInputSection, FCTextArea, FCEntry, FCSpinner, FCCheckBox, FCComboBox, \ - FCLabel, FCButton, VerticalScrollArea + FCLabel, FCButton, VerticalScrollArea, FCGridLayout from camlib import grace from shapely.geometry import MultiPolygon @@ -446,7 +446,7 @@ class OptimalUI: self.layout.addWidget(FCLabel("")) # ## Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appPlugins/ToolPaint.py b/appPlugins/ToolPaint.py index c80f5c81..44feecd5 100644 --- a/appPlugins/ToolPaint.py +++ b/appPlugins/ToolPaint.py @@ -14,7 +14,7 @@ from copy import deepcopy from appParsers.ParseGerber import Gerber from camlib import Geometry, FlatCAMRTreeStorage, grace from appGUI.GUIElements import FCTable, FCDoubleSpinner, FCCheckBox, FCInputDoubleSpinner, RadioSet, \ - FCButton, FCComboBox, FCLabel, FCComboBox2, VerticalScrollArea + FCButton, FCComboBox, FCLabel, FCComboBox2, VerticalScrollArea, FCGridLayout from shapely.geometry import base, Polygon, MultiPolygon, LinearRing, Point from shapely.ops import unary_union, linemerge @@ -2948,7 +2948,7 @@ class PaintUI: self.title_box.addWidget(self.level) # ## Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) @@ -3058,7 +3058,7 @@ class PaintUI: # ###################### ADD A NEW TOOL ######################################## # ############################################################################## - self.grid3 = QtWidgets.QGridLayout() + self.grid3 = FCGridLayout(v_spacing=3) self.grid3.setColumnStretch(0, 0) self.grid3.setColumnStretch(1, 1) self.tools_box.addLayout(self.grid3) @@ -3084,7 +3084,7 @@ class PaintUI: # ############################################################################################################# # ################################ Button Grid ########################################################### # ############################################################################################################# - button_grid = QtWidgets.QGridLayout() + button_grid = FCGridLayout(v_spacing=3) button_grid.setColumnStretch(0, 1) button_grid.setColumnStretch(1, 0) self.grid3.addLayout(button_grid, 7, 0, 1, 2) @@ -3138,7 +3138,7 @@ class PaintUI: ) self.grid3.addWidget(self.tool_data_label, 12, 0, 1, 2) - grid4 = QtWidgets.QGridLayout() + grid4 = FCGridLayout(v_spacing=3) grid4.setColumnStretch(0, 0) grid4.setColumnStretch(1, 1) self.tools_box.addLayout(grid4) diff --git a/appPlugins/ToolPanelize.py b/appPlugins/ToolPanelize.py index d14e8e65..cee9c326 100644 --- a/appPlugins/ToolPanelize.py +++ b/appPlugins/ToolPanelize.py @@ -9,7 +9,7 @@ from PyQt6 import QtWidgets, QtGui, QtCore from appTool import AppTool from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCCheckBox, OptionalInputSection, FCComboBox, \ - FCButton, FCLabel, VerticalScrollArea + FCButton, FCLabel, VerticalScrollArea, FCGridLayout from camlib import grace from copy import deepcopy @@ -1127,7 +1127,7 @@ class PanelizeUI: self.level.setCheckable(True) self.title_box.addWidget(self.level) - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) diff --git a/appPlugins/ToolPcbWizard.py b/appPlugins/ToolPcbWizard.py index 319a0239..625327a3 100644 --- a/appPlugins/ToolPcbWizard.py +++ b/appPlugins/ToolPcbWizard.py @@ -8,7 +8,7 @@ from PyQt6 import QtWidgets, QtCore from appTool import AppTool -from appGUI.GUIElements import RadioSet, FCSpinner, FCButton, FCTable, FCLabel, VerticalScrollArea +from appGUI.GUIElements import RadioSet, FCSpinner, FCButton, FCTable, FCLabel, VerticalScrollArea, FCGridLayout import re import os @@ -416,7 +416,7 @@ class WizardUI: self.layout.addWidget(FCLabel("%s:" % _("Load files"))) # Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) @@ -456,7 +456,7 @@ class WizardUI: self.layout.addWidget(FCLabel("%s:" % _("Excellon Format"))) # Grid Layout - grid01 = QtWidgets.QGridLayout() + grid01 = FCGridLayout(v_spacing=3) grid01.setColumnStretch(0, 0) grid01.setColumnStretch(1, 1) self.layout.addLayout(grid01) diff --git a/appPlugins/ToolPunchGerber.py b/appPlugins/ToolPunchGerber.py index 697c849b..d4386310 100644 --- a/appPlugins/ToolPunchGerber.py +++ b/appPlugins/ToolPunchGerber.py @@ -9,7 +9,7 @@ from PyQt6 import QtCore, QtWidgets, QtGui from appTool import AppTool from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCComboBox, FCTable, FCButton, FCLabel, \ - VerticalScrollArea + VerticalScrollArea, FCGridLayout from copy import deepcopy import logging @@ -1991,7 +1991,7 @@ class PunchUI: self.layout.addWidget(FCLabel("")) # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 1) grid_lay.setColumnStretch(1, 0) @@ -2023,12 +2023,12 @@ class PunchUI: grid_lay.addWidget(self.padt_label, 3, 0, 1, 2) - pad_all_grid = QtWidgets.QGridLayout() + pad_all_grid = FCGridLayout(v_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 = QtWidgets.QGridLayout() + pad_grid = FCGridLayout(v_spacing=3) pad_grid.setColumnStretch(0, 0) pad_all_grid.addLayout(pad_grid, 0, 0) @@ -2110,7 +2110,7 @@ class PunchUI: grid_lay.addWidget(separator_line, 10, 0, 1, 2) # Grid Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) @@ -2192,7 +2192,7 @@ class PunchUI: self.ring_box.addWidget(self.ring_label) # ## Grid Layout - self.grid1 = QtWidgets.QGridLayout() + self.grid1 = FCGridLayout(v_spacing=3) self.grid1.setColumnStretch(0, 0) self.grid1.setColumnStretch(1, 1) self.ring_box.addLayout(self.grid1) diff --git a/appPlugins/ToolQRCode.py b/appPlugins/ToolQRCode.py index ff34def7..d07efa72 100644 --- a/appPlugins/ToolQRCode.py +++ b/appPlugins/ToolQRCode.py @@ -10,7 +10,7 @@ from PyQt6.QtCore import Qt from appTool import AppTool from appGUI.GUIElements import RadioSet, FCTextArea, FCSpinner, FCEntry, FCCheckBox, FCComboBox, FCFileSaveDialog, \ - VerticalScrollArea + VerticalScrollArea, FCGridLayout from appParsers.ParseSVG import * from shapely.geometry.base import * @@ -761,7 +761,7 @@ class QRcodeUI: self.layout.addWidget(QtWidgets.QLabel('')) # ## Grid Layout - i_grid_lay = QtWidgets.QGridLayout() + i_grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(i_grid_lay) i_grid_lay.setColumnStretch(0, 0) i_grid_lay.setColumnStretch(1, 1) @@ -803,7 +803,7 @@ class QRcodeUI: i_grid_lay.addWidget(separator_line, 7, 0, 1, 2) # ## Grid Layout - grid_lay = QtWidgets.QGridLayout() + grid_lay = FCGridLayout(v_spacing=3) self.layout.addLayout(grid_lay) grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) @@ -926,7 +926,7 @@ class QRcodeUI: self.export_frame = QtWidgets.QFrame() self.export_frame.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.export_frame) - self.export_lay = QtWidgets.QGridLayout() + self.export_lay = FCGridLayout(v_spacing=3) self.export_lay.setContentsMargins(0, 0, 0, 0) self.export_frame.setLayout(self.export_lay) self.export_lay.setColumnStretch(0, 0) diff --git a/appPlugins/ToolRulesCheck.py b/appPlugins/ToolRulesCheck.py index 223b3ecb..adbaad1d 100644 --- a/appPlugins/ToolRulesCheck.py +++ b/appPlugins/ToolRulesCheck.py @@ -9,7 +9,7 @@ from PyQt6 import QtWidgets, QtGui from appTool import AppTool from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, OptionalInputSection, FCComboBox, FCLabel, FCButton, \ - VerticalScrollArea + VerticalScrollArea, FCGridLayout from copy import deepcopy from appPool import * @@ -1193,7 +1193,7 @@ class RulesUI: self.layout.addWidget(title_label) # Form Layout - self.grid_layout = QtWidgets.QGridLayout() + self.grid_layout = FCGridLayout(v_spacing=3) self.layout.addLayout(self.grid_layout) self.grid_layout.setColumnStretch(0, 0) @@ -1398,7 +1398,7 @@ class RulesUI: self.layout.addWidget(self.all_cb) # Form Layout - self.grid_lay1 = QtWidgets.QGridLayout() + self.grid_lay1 = FCGridLayout(v_spacing=3) self.grid_lay1.setColumnStretch(0, 0) self.grid_lay1.setColumnStretch(1, 1) self.layout.addLayout(self.grid_lay1) diff --git a/appPlugins/ToolSolderPaste.py b/appPlugins/ToolSolderPaste.py index 4a90ff07..86a24ac6 100644 --- a/appPlugins/ToolSolderPaste.py +++ b/appPlugins/ToolSolderPaste.py @@ -10,7 +10,7 @@ from PyQt6 import QtGui, QtCore, QtWidgets from appTool import AppTool from appCommon.Common import LoudDict from appGUI.GUIElements import FCComboBox, FCEntry, FCTable, FCDoubleSpinner, FCSpinner, FCFileSaveDialog, \ - FCInputSpinner, FCButton, VerticalScrollArea + FCInputSpinner, FCButton, VerticalScrollArea, FCGridLayout from camlib import distance from appEditors.AppTextEditor import AppTextEditor @@ -1192,7 +1192,7 @@ class SolderUI: self.layout.addWidget(title_label) # ## Form Layout - obj_form_layout = QtWidgets.QGridLayout() + obj_form_layout = FCGridLayout(v_spacing=3) obj_form_layout.setColumnStretch(0, 0) obj_form_layout.setColumnStretch(1, 1) self.layout.addLayout(obj_form_layout) @@ -1244,7 +1244,7 @@ class SolderUI: "is the width of the solder paste dispensed.")) # ### Add a new Tool ## ## - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.layout.addLayout(grid0) @@ -1291,7 +1291,7 @@ class SolderUI: self.gcode_frame.setLayout(self.tool_box) # Parameter Layout - self.param_grid = QtWidgets.QGridLayout() + self.param_grid = FCGridLayout(v_spacing=3) self.tool_box.addLayout(self.param_grid) step1_lbl = QtWidgets.QLabel("%s:" % _('Parameters')) @@ -1503,7 +1503,7 @@ class SolderUI: self.param_grid.addWidget(separator_line, 30, 0, 1, 2) # Buttons Grid - self.button_grid = QtWidgets.QGridLayout() + self.button_grid = FCGridLayout(v_spacing=3) self.button_grid.setColumnStretch(0, 0) self.button_grid.setColumnStretch(1, 1) self.tool_box.addLayout(self.button_grid) diff --git a/appPlugins/ToolSub.py b/appPlugins/ToolSub.py index 05f7d3e8..c8f21ff8 100644 --- a/appPlugins/ToolSub.py +++ b/appPlugins/ToolSub.py @@ -8,7 +8,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui from appTool import AppTool -from appGUI.GUIElements import FCCheckBox, FCButton, FCComboBox, FCLabel, VerticalScrollArea +from appGUI.GUIElements import FCCheckBox, FCButton, FCComboBox, FCLabel, VerticalScrollArea, FCGridLayout from shapely.geometry import Polygon, MultiPolygon, MultiLineString, LineString from shapely.ops import unary_union @@ -813,7 +813,7 @@ class SubUI: self.tools_frame.setLayout(self.tools_box) # Form Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) self.tools_box.addLayout(grid0) diff --git a/appPlugins/ToolTransform.py b/appPlugins/ToolTransform.py index d63976c0..a72b5bed 100644 --- a/appPlugins/ToolTransform.py +++ b/appPlugins/ToolTransform.py @@ -8,7 +8,7 @@ from PyQt6 import QtWidgets, QtGui, QtCore from appTool import AppTool from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCButton, OptionalInputSection, FCComboBox, \ - NumericalEvalTupleEntry, FCLabel, VerticalScrollArea + NumericalEvalTupleEntry, FCLabel, VerticalScrollArea, FCGridLayout import numpy as np @@ -598,7 +598,7 @@ class TransformUI: self.layout.addWidget(FCLabel("")) # ## Layout - grid0 = QtWidgets.QGridLayout() + grid0 = FCGridLayout(v_spacing=3) self.layout.addLayout(grid0) grid0.setColumnStretch(0, 0) grid0.setColumnStretch(1, 1) diff --git a/app_Main.py b/app_Main.py index fd877cbe..8d3b6fde 100644 --- a/app_Main.py +++ b/app_Main.py @@ -75,7 +75,7 @@ from appGUI.PlotCanvas import * from appGUI.PlotCanvasLegacy import * from appGUI.PlotCanvas3d import * from appGUI.MainGUI import * -from appGUI.GUIElements import FCFileSaveDialog, message_dialog, FlatCAMSystemTray, FCInputDialogSlider +from appGUI.GUIElements import FCFileSaveDialog, message_dialog, FlatCAMSystemTray, FCInputDialogSlider, FCGridLayout # FlatCAM Pre-processors from appPreProcessor import load_preprocessors @@ -3421,7 +3421,7 @@ class App(QtCore.QObject): }, ] - self.prog_grid_lay = QtWidgets.QGridLayout() + self.prog_grid_lay = FCGridLayout(v_spacing=3) self.prog_grid_lay.setHorizontalSpacing(20) self.prog_grid_lay.setColumnStretch(0, 0) self.prog_grid_lay.setColumnStretch(2, 1) @@ -3464,7 +3464,7 @@ class App(QtCore.QObject): self.prog_grid_lay.addWidget(QtWidgets.QLabel(''), line, 0) line += 1 - self.translator_grid_lay = QtWidgets.QGridLayout() + self.translator_grid_lay = FCGridLayout(v_spacing=3) self.translator_grid_lay.setColumnStretch(0, 0) self.translator_grid_lay.setColumnStretch(1, 0) self.translator_grid_lay.setColumnStretch(2, 1) @@ -3684,7 +3684,7 @@ class App(QtCore.QObject): self.intro_tab_layout.setContentsMargins(2, 2, 2, 2) tab_widget.addTab(self.intro_tab, _("Contribute")) - self.grid_lay = QtWidgets.QGridLayout() + self.grid_lay = FCGridLayout(v_spacing=3) self.grid_lay.setHorizontalSpacing(20) self.grid_lay.setColumnStretch(0, 0) self.grid_lay.setColumnStretch(1, 1)