From b98604b9005e31f939db374cbf87aa5bae0844cc Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 19 Sep 2021 04:52:49 +0300 Subject: [PATCH] - In Plugins: Calculators, Copper Thieving, Corners, Extract, Fiducials and Film activated the harmonizing first column width in the Plugin UI --- CHANGELOG.md | 1 + appPlugins/ToolCalculators.py | 33 ++++++++++++++++++++------------ appPlugins/ToolCopperThieving.py | 4 ++-- appPlugins/ToolCorners.py | 2 ++ appPlugins/ToolExtract.py | 3 +++ appPlugins/ToolFiducials.py | 2 ++ appPlugins/ToolFilm.py | 13 +++++-------- 7 files changed, 36 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c4279b5..62c3fdaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ CHANGELOG for FlatCAM beta - fixed INFO in Gerber Object UI to show correctly the type of geometric element in Follow geometry - in INFO functionality for Gerber Object made the difference if the Follow geometry is not a Point or a LineString - In Plugins: Panelize, Cutout, Extract, Copper Thieving disabled the autoload of the last created APP object +- In Plugins: Calculators, Copper Thieving, Corners, Extract, Fiducials and Film activated the harmonizing first column width in the Plugin UI 18.09.2021 diff --git a/appPlugins/ToolCalculators.py b/appPlugins/ToolCalculators.py index da29573a..4d572955 100644 --- a/appPlugins/ToolCalculators.py +++ b/appPlugins/ToolCalculators.py @@ -531,7 +531,7 @@ class CalcUI: # ##################### # ## Title of the Units Calculator - units_label = FCLabel('%s' % self.unitsName) + units_label = FCLabel('%s' % self.unitsName) self.layout.addWidget(units_label) units_frame = FCFrame() @@ -593,7 +593,7 @@ class CalcUI: # ################################ V-shape Tool Calculator #################################################### # ############################################################################################################# # ## Title of the V-shape Tools Calculator - v_shape_title_label = FCLabel('%s' % self.v_shapeName) + v_shape_title_label = FCLabel('%s' % self.v_shapeName) self.layout.addWidget(v_shape_title_label) v_frame = FCFrame() @@ -667,7 +667,7 @@ class CalcUI: # ############################## ElectroPlating Tool Calculator ############################################### # ############################################################################################################# # ## Title of the ElectroPlating Tools Calculator - tin_title_label = FCLabel('%s' % self.eplateName) + tin_title_label = FCLabel('%s' % self.eplateName) tin_title_label.setToolTip( _("This calculator is useful for those who plate the via/pad/drill holes,\n" "using a method like graphite ink or calcium hypophosphite ink or palladium chloride.") @@ -699,7 +699,8 @@ class CalcUI: self.pcblengthlabel = FCLabel('%s:' % _("Board Length")) self.pcblengthlabel.setToolTip(_('Board Length.')) self.pcblength_entry = FCDoubleSpinner(callback=self.confirmation_message) - self.pcblength_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Preferred) + self.pcblength_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, + QtWidgets.QSizePolicy.Policy.Preferred) self.pcblength_entry.set_precision(self.decimals) self.pcblength_entry.set_range(0.0, 10000.0000) @@ -717,7 +718,8 @@ class CalcUI: self.pcbwidthlabel = FCLabel('%s:' % _("Board Width")) self.pcbwidthlabel.setToolTip(_('Board Width')) self.pcbwidth_entry = FCDoubleSpinner(callback=self.confirmation_message) - self.pcbwidth_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Preferred) + self.pcbwidth_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, + QtWidgets.QSizePolicy.Policy.Preferred) self.pcbwidth_entry.set_precision(self.decimals) self.pcbwidth_entry.set_range(0.0, 10000.0000) @@ -735,7 +737,8 @@ class CalcUI: self.area_label = FCLabel('%s:' % _("Area")) self.area_label.setToolTip(_('Board area.')) self.area_entry = FCDoubleSpinner(callback=self.confirmation_message) - self.area_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Preferred) + self.area_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, + QtWidgets.QSizePolicy.Policy.Preferred) self.area_entry.set_precision(self.decimals) self.area_entry.set_range(0.0, 10000.0000) @@ -759,7 +762,8 @@ class CalcUI: self.cdensity_label.setToolTip(_("Current density applied to the board. \n" "In Amperes per Square Feet ASF.")) self.cdensity_entry = FCDoubleSpinner(callback=self.confirmation_message) - self.cdensity_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Preferred) + self.cdensity_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, + QtWidgets.QSizePolicy.Policy.Preferred) self.cdensity_entry.set_precision(self.decimals) self.cdensity_entry.set_range(0.0, 10000.0000) self.cdensity_entry.setSingleStep(0.1) @@ -778,7 +782,8 @@ class CalcUI: self.growth_label = FCLabel('%s:' % _("Copper Growth")) self.growth_label.setToolTip(_("Thickness of the deposited copper.")) self.growth_entry = FCDoubleSpinner(callback=self.confirmation_message) - self.growth_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Preferred) + self.growth_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, + QtWidgets.QSizePolicy.Policy.Preferred) self.growth_entry.set_precision(self.decimals) self.growth_entry.set_range(0.0, 10000.0000) self.growth_entry.setSingleStep(0.01) @@ -798,7 +803,8 @@ class CalcUI: self.cvaluelabel.setToolTip(_('This is the current intensity value\n' 'to be set on the Power Supply.')) self.cvalue_entry = FCDoubleSpinner(callback=self.confirmation_message) - self.cvalue_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Preferred) + self.cvalue_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, + QtWidgets.QSizePolicy.Policy.Preferred) self.cvalue_entry.set_precision(self.decimals) self.cvalue_entry.set_range(0.0, 10000.0000) self.cvalue_entry.setSingleStep(0.1) @@ -818,7 +824,8 @@ class CalcUI: self.timelabel = FCLabel('%s:' % _("Time")) self.timelabel.setToolTip(_('The time calculated to deposit copper.')) self.time_entry = FCDoubleSpinner(callback=self.confirmation_message) - self.time_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Preferred) + self.time_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, + QtWidgets.QSizePolicy.Policy.Preferred) self.time_entry.set_precision(self.decimals) self.time_entry.set_range(0.0, 10000.0000) self.time_entry.setSingleStep(0.1) @@ -937,7 +944,7 @@ class CalcUI: self.h2o_label.setToolTip(_('Distilled Water.')) self.h2o_entry = FCDoubleSpinner(callback=self.confirmation_message) self.h2o_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, - QtWidgets.QSizePolicy.Policy.Preferred) + QtWidgets.QSizePolicy.Policy.Preferred) self.h2o_entry.lineEdit().setReadOnly(True) self.h2o_entry.set_precision(self.decimals) self.h2o_entry.set_range(0.0, 10000.0000) @@ -957,7 +964,7 @@ class CalcUI: self.soap_label.setToolTip(_('Liquid soap.')) self.soap_entry = FCDoubleSpinner(callback=self.confirmation_message) self.soap_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, - QtWidgets.QSizePolicy.Policy.Preferred) + QtWidgets.QSizePolicy.Policy.Preferred) self.soap_entry.lineEdit().setReadOnly(True) self.soap_entry.set_precision(self.decimals) self.soap_entry.set_range(0.0, 10000.0000) @@ -1035,6 +1042,8 @@ class CalcUI: ) grid_tin.addWidget(self.calculate_tin_button, 30, 0, 1, 2) + FCGridLayout.set_common_column_size([grid_units_layout, grid_electro, grid_vshape, grid_tin], 0) + self.layout.addStretch(1) # ## Reset Tool diff --git a/appPlugins/ToolCopperThieving.py b/appPlugins/ToolCopperThieving.py index 6dfe4f44..01aabbb0 100644 --- a/appPlugins/ToolCopperThieving.py +++ b/appPlugins/ToolCopperThieving.py @@ -1771,8 +1771,8 @@ class ThievingUI: grid_lay_2.addWidget(self.ppm_choice_label, 6, 0) grid_lay_2.addWidget(self.ppm_choice_combo, 6, 1, 1, 2) - # FCGridLayout.set_common_column_size( - # [i_grid_lay, grid_lay, grid_lay_1, grid_lay_2, dots_grid, squares_grid, lines_grid], 0, FCLabel) + FCGridLayout.set_common_column_size( + [i_grid_lay, grid_lay, grid_lay_1, grid_lay_2, dots_grid, squares_grid, lines_grid], 0) # ############################################################################################################# # ## Pattern Plating Mask Button diff --git a/appPlugins/ToolCorners.py b/appPlugins/ToolCorners.py index c5542c4e..a6aaa95a 100644 --- a/appPlugins/ToolCorners.py +++ b/appPlugins/ToolCorners.py @@ -1046,6 +1046,8 @@ class CornersUI: grid_drill.addWidget(self.drill_dia_label, 0, 0) grid_drill.addWidget(self.drill_dia_entry, 0, 1) + FCGridLayout.set_common_column_size([grid_sel, grid_par, grid_loc, grid_drill], 0) + # ## Create an Excellon object self.drill_button = FCButton(_("Create Excellon Object")) self.drill_button.setIcon(QtGui.QIcon(self.app.resource_location + '/drill32.png')) diff --git a/appPlugins/ToolExtract.py b/appPlugins/ToolExtract.py index 27f4bf8b..8880ca6e 100644 --- a/appPlugins/ToolExtract.py +++ b/appPlugins/ToolExtract.py @@ -1365,6 +1365,9 @@ class ExtractUI: ec_grid.addWidget(self.thick_cut_label, 2, 0) ec_grid.addWidget(self.thick_cut_entry, 2, 1) + FCGridLayout.set_common_column_size( + [grid1, grid_lay, ring_grid, ec_grid, prop_grid, fixed_grid, ring_grid, es_grid, pad_all_grid, pad_grid], 0) + # ############################################################################################################# # Extract cutout from Gerber apertures flashes (pads) BUTTON # ############################################################################################################# diff --git a/appPlugins/ToolFiducials.py b/appPlugins/ToolFiducials.py index 9682624f..af7b40b2 100644 --- a/appPlugins/ToolFiducials.py +++ b/appPlugins/ToolFiducials.py @@ -1074,6 +1074,8 @@ class FidoUI: grid_sel.addWidget(self.mode_label, 0, 0) grid_sel.addWidget(self.mode_radio, 0, 1) + FCGridLayout.set_common_column_size([grid_sel, grid_par, grid_par], 0) + # ## Insert Copper Fiducial self.add_cfid_button = FCButton(_("Add Fiducial")) self.add_cfid_button.setIcon(QtGui.QIcon(self.app.resource_location + '/fiducials_32.png')) diff --git a/appPlugins/ToolFilm.py b/appPlugins/ToolFilm.py index 965e5081..abbb558d 100644 --- a/appPlugins/ToolFilm.py +++ b/appPlugins/ToolFilm.py @@ -1514,20 +1514,17 @@ class FilmUI: punch_grid.addWidget(self.source_label, 0, 0) punch_grid.addWidget(self.source_punch, 0, 1) - self.exc_label = FCLabel('%s:' % _("Excellon Obj")) - self.exc_label.setToolTip( + self.exc_combo = FCComboBox() + self.exc_combo.setToolTip( _("Remove the geometry of Excellon from the Film to create the holes in pads.") ) - self.exc_combo = FCComboBox() self.exc_combo.setModel(self.app.collection) self.exc_combo.setRootModelIndex(self.app.collection.index(1, 0, QtCore.QModelIndex())) self.exc_combo.is_last = True self.exc_combo.obj_type = "Excellon" - punch_grid.addWidget(self.exc_label, 2, 0) - punch_grid.addWidget(self.exc_combo, 2, 1) + punch_grid.addWidget(self.exc_combo, 2, 0, 1, 2) - self.exc_label.hide() self.exc_combo.hide() self.punch_size_label = FCLabel('%s:' % _("Punch Size")) @@ -1669,6 +1666,8 @@ class FilmUI: self.png_dpi_label.hide() self.png_dpi_spinner.hide() + FCGridLayout.set_common_column_size([grid1, grid_par, grid0, grid3, punch_grid], 0) + # Buttons self.film_object_button = FCButton(_("Save Film")) self.film_object_button.setIcon(QtGui.QIcon(self.app.resource_location + '/save_as.png')) @@ -1745,12 +1744,10 @@ class FilmUI: if val == 'pad' and self.punch_cb.get_value(): self.punch_size_label.show() self.punch_size_spinner.show() - self.exc_label.hide() self.exc_combo.hide() else: self.punch_size_label.hide() self.punch_size_spinner.hide() - self.exc_label.show() self.exc_combo.show() if val == 'pad' and self.tf_type_obj_combo.get_value() == 'geo':