From 8266b5c98871a7f0e0f9b89cdfd6aa77fff0eaef Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 9 Sep 2021 01:43:51 +0300 Subject: [PATCH] - some changes in the Preferences UI for Film and Fiducial Plugins --- CHANGELOG.md | 2 + .../tools/Tools2FiducialsPrefGroupUI.py | 2 +- .../preferences/tools/ToolsFilmPrefGroupUI.py | 54 ++++++++++++------- 3 files changed, 39 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f44ff27..cc253458 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ CHANGELOG for FlatCAM beta - in Fiducials Plugin updated the GUI to the new style - Fiducials Plugin: replaced a Radio button with a Combobox2 and optimized the UI - The Combobox2 GUI element no longer issue an exception if it is tried to set a string value, it will set automatically the index 0 +- some changes in the Preferences UI for Film and Fiducial Plugins + 8.09.2021 diff --git a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py index d749372f..ab183e1f 100644 --- a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py @@ -120,7 +120,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Selection Frame # ############################################################################################################# - self.sel_label = FCLabel('%s' % _("Selection")) + self.sel_label = FCLabel('%s' % _("Selection")) self.layout.addWidget(self.sel_label) s_frame = FCFrame() diff --git a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py index 4aa249f7..d92881bd 100644 --- a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py @@ -25,7 +25,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Adjustments Frame # ############################################################################################################# - self.film_adj_label = FCLabel('%s' % _("Adjustments")) + self.film_adj_label = FCLabel('%s' % _("Adjustments")) self.film_adj_label.setToolTip( _("Compensate print distortions.") ) @@ -53,6 +53,15 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): ) grid0.addWidget(self.film_scale_cb, 2, 0, 1, 2) + # SCALE FRAME + scale_frame = FCFrame() + grid0.addWidget(scale_frame, 4, 0, 1, 2) + + grid_scale = FCGridLayout(v_spacing=5, h_spacing=3) + grid_scale.setColumnStretch(0, 0) + grid_scale.setColumnStretch(1, 1) + scale_frame.setLayout(grid_scale) + # Scale X factor self.film_scalex_label = FCLabel('%s:' % _("X factor")) self.film_scalex_entry = FCDoubleSpinner() @@ -60,8 +69,8 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): self.film_scalex_entry.set_precision(self.decimals) self.film_scalex_entry.setSingleStep(0.01) - grid0.addWidget(self.film_scalex_label, 4, 0) - grid0.addWidget(self.film_scalex_entry, 4, 1) + grid_scale.addWidget(self.film_scalex_label, 0, 0) + grid_scale.addWidget(self.film_scalex_entry, 0, 1) # Scale Y factor self.film_scaley_label = FCLabel('%s:' % _("Y factor")) @@ -70,8 +79,8 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): self.film_scaley_entry.set_precision(self.decimals) self.film_scaley_entry.setSingleStep(0.01) - grid0.addWidget(self.film_scaley_label, 6, 0) - grid0.addWidget(self.film_scaley_entry, 6, 1) + grid_scale.addWidget(self.film_scaley_label, 2, 0) + grid_scale.addWidget(self.film_scaley_entry, 2, 1) # Scale reference self.scale_ref_label = FCLabel('%s:' % _("Reference")) @@ -83,8 +92,8 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): self.film_scale_ref_combo.addItems( [_('Center'), _('Bottom Left'), _('Top Left'), _('Bottom Right'), _('Top right')]) - grid0.addWidget(self.scale_ref_label, 8, 0) - grid0.addWidget(self.film_scale_ref_combo, 8, 1) + grid_scale.addWidget(self.scale_ref_label, 4, 0) + grid_scale.addWidget(self.film_scale_ref_combo, 4, 1) # Skew Geometry self.film_skew_cb = FCCheckBox('%s' % _("Skew")) @@ -97,7 +106,16 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): QCheckBox {font-weight: bold; color: black} """ ) - grid0.addWidget(self.film_skew_cb, 10, 0, 1, 2) + grid0.addWidget(self.film_skew_cb, 6, 0, 1, 2) + + # SKEW FRAME + skew_frame = FCFrame() + grid0.addWidget(skew_frame, 8, 0, 1, 2) + + grid_skew = FCGridLayout(v_spacing=5, h_spacing=3) + grid_skew.setColumnStretch(0, 0) + grid_skew.setColumnStretch(1, 1) + skew_frame.setLayout(grid_skew) self.film_skewx_label = FCLabel('%s:' % _("X angle")) self.film_skewx_entry = FCDoubleSpinner() @@ -105,8 +123,8 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): self.film_skewx_entry.set_precision(self.decimals) self.film_skewx_entry.setSingleStep(0.01) - grid0.addWidget(self.film_skewx_label, 12, 0) - grid0.addWidget(self.film_skewx_entry, 12, 1) + grid_skew.addWidget(self.film_skewx_label, 0, 0) + grid_skew.addWidget(self.film_skewx_entry, 0, 1) self.film_skewy_label = FCLabel('%s:' % _("Y angle")) self.film_skewy_entry = FCDoubleSpinner() @@ -114,8 +132,8 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): self.film_skewy_entry.set_precision(self.decimals) self.film_skewy_entry.setSingleStep(0.01) - grid0.addWidget(self.film_skewy_label, 14, 0) - grid0.addWidget(self.film_skewy_entry, 14, 1) + grid_skew.addWidget(self.film_skewy_label, 2, 0) + grid_skew.addWidget(self.film_skewy_entry, 2, 1) # Skew Reference self.skew_ref_label = FCLabel('%s:' % _("Reference")) @@ -127,8 +145,8 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): self.film_skew_ref_combo.addItems( [_('Center'), _('Bottom Left'), _('Top Left'), _('Bottom Right'), _('Top right')]) - grid0.addWidget(self.skew_ref_label, 16, 0) - grid0.addWidget(self.film_skew_ref_combo, 16, 1) + grid_skew.addWidget(self.skew_ref_label, 4, 0) + grid_skew.addWidget(self.film_skew_ref_combo, 4, 1) # Mirror Geometry self.film_mirror_cb = FCCheckBox('%s' % _("Mirror")) @@ -140,7 +158,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): QCheckBox {font-weight: bold; color: black} """ ) - grid0.addWidget(self.film_mirror_cb, 18, 0, 1, 2) + grid0.addWidget(self.film_mirror_cb, 10, 0, 1, 2) self.film_mirror_axis = RadioSet([{'label': _('X'), 'value': 'x'}, {'label': _('Y'), 'value': 'y'}, @@ -148,8 +166,8 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): stretch=False) self.film_mirror_axis_label = FCLabel('%s:' % _("Mirror Axis")) - grid0.addWidget(self.film_mirror_axis_label, 20, 0) - grid0.addWidget(self.film_mirror_axis, 20, 1) + grid0.addWidget(self.film_mirror_axis_label, 12, 0) + grid0.addWidget(self.film_mirror_axis, 12, 1) # separator_line3 = QtWidgets.QFrame() # separator_line3.setFrameShape(QtWidgets.QFrame.Shape.HLine) @@ -159,7 +177,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Parameters Frame # ############################################################################################################# - self.film_label = FCLabel("%s:" % _("Parameters")) + self.film_label = FCLabel('%s' % _("Parameters")) self.film_label.setToolTip( _("Create a PCB film from a Gerber or Geometry object.\n" "The file is saved in SVG format.")