From 08d3a580ac30247977fcab070bbfaad12ddc9581 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sat, 25 Sep 2021 21:08:15 +0300 Subject: [PATCH] - multiple UI changes in Preferences - UI changes in the Paint Plugin --- CHANGELOG.md | 2 + appDatabase.py | 4 +- appEditors/AppGeoEditor.py | 2 +- appGUI/GUIElements.py | 15 +- appGUI/ObjectUI.py | 2 +- appGUI/preferences/OptionUI.py | 5 +- appGUI/preferences/PreferencesUIManager.py | 2 +- .../cncjob/CNCJobGenPrefGroupUI.py | 2 +- .../cncjob/CNCJobOptPrefGroupUI.py | 2 +- .../excellon/ExcellonGenPrefGroupUI.py | 2 +- .../general/GeneralAPPSetGroupUI.py | 202 +++++---- .../general/GeneralAppPrefGroupUI.py | 391 ++++++++++-------- .../general/GeneralAppSettingsGroupUI.py | 4 +- .../general/GeneralGUIPrefGroupUI.py | 108 ++--- .../geometry/GeometryGenPrefGroupUI.py | 2 +- .../tools/Tools2CThievingPrefGroupUI.py | 2 +- .../preferences/tools/Tools2CalPrefGroupUI.py | 2 +- .../tools/Tools2ExtractPrefGroupUI.py | 2 +- .../tools/Tools2FiducialsPrefGroupUI.py | 4 +- .../tools/Tools2InvertPrefGroupUI.py | 2 +- .../tools/Tools2PunchGerberPrefGroupUI.py | 2 +- .../tools/Tools2sidedPrefGroupUI.py | 61 ++- .../preferences/tools/ToolsFilmPrefGroupUI.py | 10 +- .../tools/ToolsLevelPrefGroupUI.py | 61 +-- .../preferences/tools/ToolsNCCPrefGroupUI.py | 10 +- .../tools/ToolsPaintPrefGroupUI.py | 153 ++++--- appPlugins/ToolCalculators.py | 4 +- appPlugins/ToolCalibration.py | 2 +- appPlugins/ToolCopperThieving.py | 4 +- appPlugins/ToolCutOut.py | 2 +- appPlugins/ToolDblSided.py | 6 +- appPlugins/ToolEtchCompensation.py | 2 +- appPlugins/ToolExtract.py | 2 +- appPlugins/ToolFiducials.py | 4 +- appPlugins/ToolFilm.py | 12 +- appPlugins/ToolInvertGerber.py | 2 +- appPlugins/ToolMilling.py | 189 ++++----- appPlugins/ToolNCC.py | 10 +- appPlugins/ToolPaint.py | 87 ++-- appPlugins/ToolPunchGerber.py | 2 +- app_Main.py | 6 +- defaults.py | 2 +- 42 files changed, 762 insertions(+), 628 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3416d179..c623cd3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ CHANGELOG for FlatCAM beta - solved more Shapely 2.0 deprecation warnings - in Isolation Plugin and NCC Plugin changed the UI and the Preferences for those Plugins - in Gerber Editor, the Region Tool now will draw only for the '0' aperture therefore the utility geometry will be a very thin line +- multiple UI changes in Preferences +- UI changes in the Paint Plugin 24.09.2021 diff --git a/appDatabase.py b/appDatabase.py index cbaa7d83..656f05c2 100644 --- a/appDatabase.py +++ b/appDatabase.py @@ -588,7 +588,7 @@ class ToolsDB2UI: self.ncc_op_radio = RadioSet([ {"label": _("Clear"), "value": "clear"}, {"label": _("Isolation"), "value": "iso"} - ], orientation='horizontal', stretch=False) + ], orientation='horizontal', compact=True) self.ncc_op_radio.setObjectName("gdb_n_operation") self.grid2.addWidget(op_label, 13, 0) @@ -1151,7 +1151,7 @@ class ToolsDB2UI: {'label': _('Thin'), 'value': 'bt'}, {'label': "M-Bites", 'value': 'mb'} ], - stretch=True + compact=True ) self.cutout_gaptype_radio.setObjectName('gdb_ct_gap_type') diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index 6124f35e..151c6a1c 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -562,7 +562,7 @@ class PaintOptionsTool(AppTool): # {"label": _("Standard"), "value": "standard"}, # {"label": _("Seed-based"), "value": "seed"}, # {"label": _("Straight lines"), "value": "lines"} - # ], orientation='vertical', stretch=False) + # ], orientation='vertical', compact=True) self.paintmethod_combo = FCComboBox() self.paintmethod_combo.addItems( [_("Standard"), _("Seed"), _("Lines")] diff --git a/appGUI/GUIElements.py b/appGUI/GUIElements.py index 919f3d7f..d7a56950 100644 --- a/appGUI/GUIElements.py +++ b/appGUI/GUIElements.py @@ -40,7 +40,7 @@ EDIT_SIZE_HINT = 70 class RadioSet(QtWidgets.QWidget): activated_custom = QtCore.pyqtSignal(str) - def __init__(self, choices, orientation='horizontal', parent=None, stretch=None): + def __init__(self, choices, orientation='horizontal', parent=None, compact=False): """ The choices are specified as a list of dictionaries containing: @@ -70,7 +70,7 @@ class RadioSet(QtWidgets.QWidget): layout.setContentsMargins(0, 0, 0, 0) - if stretch is False or stretch is None: + if compact is False or compact is None: pass else: layout.addStretch() @@ -115,7 +115,7 @@ class RadioSet(QtWidgets.QWidget): class RadioSetDefaults(RadioSet): - def __init__(self, choices, dictionary=None, key_spec=None, orientation='horizontal', stretch=None, parent=None): + def __init__(self, choices, dictionary=None, key_spec=None, orientation='horizontal', compact=None, parent=None): """ When a choice is made then the selected value is set in the key key_spec from the dictionary 'dictionary' The choices are specified as a list of dictionaries containing: @@ -133,7 +133,7 @@ class RadioSetDefaults(RadioSet): :type key_spec: 'str' """ - super(RadioSetDefaults, self).__init__(choices=choices, orientation=orientation, stretch=stretch, parent=parent) + super(RadioSetDefaults, self).__init__(choices=choices, orientation=orientation, compact=compact, parent=parent) self.dictionary = dictionary self.key_spec = key_spec @@ -888,7 +888,8 @@ class FCColorEntry(QtWidgets.QFrame): current_color = QtGui.QColor(self._extract_color(value)) color_dialog = QtWidgets.QColorDialog() - selected_color = color_dialog.getColor(initial=current_color, options=QtWidgets.QColorDialog.ShowAlphaChannel) + selected_color = color_dialog.getColor(initial=current_color, + options=QtWidgets.QColorDialog.ColorDialogOption.ShowAlphaChannel) if selected_color.isValid() is False: return @@ -1356,7 +1357,7 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox): :param alignment: the value is aligned to left or right :param parent: :param callback: called when the entered value is outside limits; the min and max value will be passed to it - :param policy: by default the widget will not stretch as much as possible on horizontal + :param policy: by default the widget will not compact as much as possible on horizontal """ super(FCDoubleSpinner, self).__init__(parent) self.readyToEdit = True @@ -4005,7 +4006,7 @@ class DialogBoxRadio(QtWidgets.QDialog): self.ref_radio = RadioSet([ {"label": _("Abs"), "value": "abs"}, {"label": _("Relative"), "value": "rel"} - ], orientation='horizontal', stretch=False) + ], orientation='horizontal', compact=True) self.ref_radio.set_value(reference) grid0.addWidget(self.ref_label, 0, 0) grid0.addWidget(self.ref_radio, 0, 1) diff --git a/appGUI/ObjectUI.py b/appGUI/ObjectUI.py index ec733cd3..d88906e4 100644 --- a/appGUI/ObjectUI.py +++ b/appGUI/ObjectUI.py @@ -1289,7 +1289,7 @@ class CNCObjectUI(ObjectUI): {"label": _("All"), "value": "all"}, {"label": _("Travel"), "value": "travel"}, {"label": _("Cut"), "value": "cut"} - ], stretch=False) + ], compact=True) grid0.addWidget(self.cncplot_method_label, 0, 0) grid0.addWidget(self.cncplot_method_combo, 0, 1, 1, 2) diff --git a/appGUI/preferences/OptionUI.py b/appGUI/preferences/OptionUI.py index 7975ac86..c83dacae 100644 --- a/appGUI/preferences/OptionUI.py +++ b/appGUI/preferences/OptionUI.py @@ -268,13 +268,14 @@ class DoubleSpinnerOptionUI(BasicOptionUI): class HeadingOptionUI(OptionUI): - def __init__(self, label_text: str, label_tooltip: Union[str, None] = None): + def __init__(self, label_text: str, color: Union[str, None] = None, label_tooltip: Union[str, None] = None): super().__init__(option="__heading") self.label_text = label_text self.label_tooltip = label_tooltip + self.color = color if color else "" def build_heading_widget(self): - heading = FCLabel('%s' % _(self.label_text)) + heading = FCLabel('%s' % (str(self.color), _(self.label_text))) heading.setToolTip(_(self.label_tooltip)) return heading diff --git a/appGUI/preferences/PreferencesUIManager.py b/appGUI/preferences/PreferencesUIManager.py index 1f74d5db..67d81fbc 100644 --- a/appGUI/preferences/PreferencesUIManager.py +++ b/appGUI/preferences/PreferencesUIManager.py @@ -450,7 +450,7 @@ class PreferencesUIManager: # Paint Area Tool "tools_paint_tooldia": self.ui.plugin_eng_pref_form.tools_paint_group.painttooldia_entry, - "tools_paint_order": self.ui.plugin_eng_pref_form.tools_paint_group.paint_order_radio, + "tools_paint_order": self.ui.plugin_eng_pref_form.tools_paint_group.paint_order_combo, "tools_paint_overlap": self.ui.plugin_eng_pref_form.tools_paint_group.paintoverlap_entry, "tools_paint_offset": self.ui.plugin_eng_pref_form.tools_paint_group.paintmargin_entry, "tools_paint_method": self.ui.plugin_eng_pref_form.tools_paint_group.paintmethod_combo, diff --git a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py index 8de10987..c3f2e2a2 100644 --- a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py @@ -101,7 +101,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): self.coords_type_radio = RadioSet([ {"label": _("Absolute"), "value": "G90"}, {"label": _("Incremental"), "value": "G91"} - ], orientation='vertical', stretch=False) + ], orientation='vertical', compact=True) grid0.addWidget(coords_type_label, 8, 0) grid0.addWidget(self.coords_type_radio, 8, 1) diff --git a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py index 9d736360..a7819c6d 100644 --- a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py @@ -54,7 +54,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI): {"label": _("All"), "value": "all"}, {"label": _("Travel"), "value": "travel"}, {"label": _("Cut"), "value": "cut"} - ], orientation='vertical', stretch=False) + ], orientation='vertical', compact=True) grid0.addWidget(self.cncplot_method_label, 1, 0) grid0.addWidget(self.cncplot_method_radio, 1, 1) diff --git a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py index a140abee..c6917a40 100644 --- a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py @@ -217,7 +217,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): self.excellon_optimization_radio = RadioSet([{'label': _('MetaHeuristic'), 'value': 'M'}, {'label': _('Basic'), 'value': 'B'}, {'label': _('TSA'), 'value': 'T'}], - orientation='vertical', stretch=False) + orientation='vertical', compact=True) grid2.addWidget(self.excellon_optimization_label, 9, 0) grid2.addWidget(self.excellon_optimization_radio, 9, 1) diff --git a/appGUI/preferences/general/GeneralAPPSetGroupUI.py b/appGUI/preferences/general/GeneralAPPSetGroupUI.py index 85a69fc8..f6b577ce 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, FCGridLayout + FCColorEntry, FCLabel, FCGridLayout, FCFrame from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -33,13 +33,19 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): else: self.resource_loc = 'assets/resources' - # Create a grid layout for the Application general settings - grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - self.layout.addLayout(grid0) - + # ############################################################################################################# + # Grid Settings Frame + # ############################################################################################################# # GRID Settings - self.grid_label = FCLabel('%s' % _('Grid Settings')) - grid0.addWidget(self.grid_label, 0, 0, 1, 2) + self.grid_label = FCLabel('%s' % _('Grid Settings')) + self.layout.addWidget(self.grid_label) + + grids_frame = FCFrame() + self.layout.addWidget(grids_frame) + + # Create a grid layout for the Application general settings + grids_grid = FCGridLayout(v_spacing=5, h_spacing=3) + grids_frame.setLayout(grids_grid) # Grid X Entry self.gridx_label = FCLabel('%s:' % _('X value')) @@ -50,8 +56,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): self.gridx_entry.set_precision(self.decimals) self.gridx_entry.setSingleStep(0.1) - grid0.addWidget(self.gridx_label, 2, 0) - grid0.addWidget(self.gridx_entry, 2, 1) + grids_grid.addWidget(self.gridx_label, 2, 0) + grids_grid.addWidget(self.gridx_entry, 2, 1) # Grid Y Entry self.gridy_label = FCLabel('%s:' % _('Y value')) @@ -62,8 +68,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): self.gridy_entry.set_precision(self.decimals) self.gridy_entry.setSingleStep(0.1) - grid0.addWidget(self.gridy_label, 4, 0) - grid0.addWidget(self.gridy_entry, 4, 1) + grids_grid.addWidget(self.gridy_label, 4, 0) + grids_grid.addWidget(self.gridy_entry, 4, 1) # Snap Max Entry self.snap_max_label = FCLabel('%s:' % _('Snap Max')) @@ -72,17 +78,26 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): self.snap_max_dist_entry.set_precision(self.decimals) self.snap_max_dist_entry.setSingleStep(0.1) - grid0.addWidget(self.snap_max_label, 6, 0) - grid0.addWidget(self.snap_max_dist_entry, 6, 1) + grids_grid.addWidget(self.snap_max_label, 6, 0) + grids_grid.addWidget(self.snap_max_dist_entry, 6, 1) - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 8, 0, 1, 2) + # separator_line = QtWidgets.QFrame() + # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) + # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) + # grids_grid.addWidget(separator_line, 8, 0, 1, 2) + # ############################################################################################################# + # Workspace Frame + # ############################################################################################################# # Workspace - self.workspace_label = FCLabel('%s' % _('Workspace Settings')) - grid0.addWidget(self.workspace_label, 10, 0, 1, 2) + self.workspace_label = FCLabel('%s' % _('Workspace Settings')) + self.layout.addWidget(self.workspace_label) + + wk_frame = FCFrame() + self.layout.addWidget(wk_frame) + + wk_grid = FCGridLayout(v_spacing=5, h_spacing=3) + wk_frame.setLayout(wk_grid) self.workspace_cb = FCCheckBox('%s' % _('Active')) self.workspace_cb.setToolTip( @@ -90,7 +105,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): "The purpose is to illustrate the limits for our work.") ) - grid0.addWidget(self.workspace_cb, 12, 0, 1, 2) + wk_grid.addWidget(self.workspace_cb, 0, 0, 1, 2) self.workspace_type_lbl = FCLabel('%s:' % _('Size')) self.workspace_type_lbl.setToolTip( @@ -99,8 +114,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): ) self.wk_cb = FCComboBox() - grid0.addWidget(self.workspace_type_lbl, 14, 0) - grid0.addWidget(self.wk_cb, 14, 1) + wk_grid.addWidget(self.workspace_type_lbl, 2, 0) + wk_grid.addWidget(self.wk_cb, 2, 1) self.pagesize = {} self.pagesize.update( @@ -167,19 +182,23 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): self.wk_orientation_radio = RadioSet([{'label': _('Portrait'), 'value': 'p'}, {'label': _('Landscape'), 'value': 'l'}, - ], stretch=False) + ], compact=True) - grid0.addWidget(self.wk_orientation_label, 16, 0) - grid0.addWidget(self.wk_orientation_radio, 16, 1) - - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 18, 0, 1, 2) + wk_grid.addWidget(self.wk_orientation_label, 4, 0) + wk_grid.addWidget(self.wk_orientation_radio, 4, 1) + # ############################################################################################################# + # Font Frame + # ############################################################################################################# # Font Size - self.font_size_label = FCLabel('%s' % _('Font Size')) - grid0.addWidget(self.font_size_label, 20, 0, 1, 2) + self.font_size_label = FCLabel('%s' % _('Font Size')) + self.layout.addWidget(self.font_size_label) + + fnt_frame = FCFrame() + self.layout.addWidget(fnt_frame) + + fnt_grid = FCGridLayout(v_spacing=5, h_spacing=3) + fnt_frame.setLayout(fnt_grid) # Notebook Font Size self.notebook_font_size_label = FCLabel('%s:' % _('Notebook')) @@ -199,8 +218,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): else: self.notebook_font_size_spinner.set_value(12) - grid0.addWidget(self.notebook_font_size_label, 22, 0) - grid0.addWidget(self.notebook_font_size_spinner, 22, 1) + fnt_grid.addWidget(self.notebook_font_size_label, 0, 0) + fnt_grid.addWidget(self.notebook_font_size_spinner, 0, 1) # Axis Font Size self.axis_font_size_label = FCLabel('%s:' % _('Axis')) @@ -218,8 +237,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): else: self.axis_font_size_spinner.set_value(8) - grid0.addWidget(self.axis_font_size_label, 24, 0) - grid0.addWidget(self.axis_font_size_spinner, 24, 1) + fnt_grid.addWidget(self.axis_font_size_label, 2, 0) + fnt_grid.addWidget(self.axis_font_size_spinner, 2, 1) # TextBox Font Size self.textbox_font_size_label = FCLabel('%s:' % _('Textbox')) @@ -238,8 +257,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): else: self.textbox_font_size_spinner.set_value(10) - grid0.addWidget(self.textbox_font_size_label, 26, 0) - grid0.addWidget(self.textbox_font_size_spinner, 26, 1) + fnt_grid.addWidget(self.textbox_font_size_label, 4, 0) + fnt_grid.addWidget(self.textbox_font_size_spinner, 4, 1) # HUD Font Size self.hud_font_size_label = FCLabel('%s:' % _('HUD')) @@ -257,13 +276,21 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): else: self.hud_font_size_spinner.set_value(8) - grid0.addWidget(self.hud_font_size_label, 28, 0) - grid0.addWidget(self.hud_font_size_spinner, 28, 1) + fnt_grid.addWidget(self.hud_font_size_label, 6, 0) + fnt_grid.addWidget(self.hud_font_size_spinner, 6, 1) - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 30, 0, 1, 2) + # ############################################################################################################# + # Axis Frame + # ############################################################################################################# + # Axis Size + self.axis_label = FCLabel('%s' % _('Axis')) + self.layout.addWidget(self.axis_label) + + ax_frame = FCFrame() + self.layout.addWidget(ax_frame) + + ax_grid = FCGridLayout(v_spacing=5, h_spacing=3) + ax_frame.setLayout(ax_grid) # Axis Color self.axis_color_label = FCLabel('%s:' % _('Axis Color')) @@ -272,20 +299,20 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): ) self.axis_color_entry = FCColorEntry() - grid0.addWidget(self.axis_color_label, 32, 0) - grid0.addWidget(self.axis_color_entry, 32, 1) + ax_grid.addWidget(self.axis_color_label, 0, 0) + ax_grid.addWidget(self.axis_color_entry, 0, 1) - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 34, 0, 1, 2) + # ############################################################################################################# + # Mouse Frame + # ############################################################################################################# + self.mouse_lbl = FCLabel('%s' % _('Mouse Settings')) + self.layout.addWidget(self.mouse_lbl) - # ----------------------------------------------------------- - # -------------- MOUSE SETTINGS ----------------------------- - # ----------------------------------------------------------- + m_frame = FCFrame() + self.layout.addWidget(m_frame) - self.mouse_lbl = FCLabel('%s' % _('Mouse Settings')) - grid0.addWidget(self.mouse_lbl, 36, 0, 1, 2) + m_grid = FCGridLayout(v_spacing=5, h_spacing=3) + m_frame.setLayout(m_grid) # Mouse Cursor Shape self.cursor_lbl = FCLabel('%s:' % _('Cursor Shape')) @@ -298,10 +325,10 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): self.cursor_radio = RadioSet([ {"label": _("Small"), "value": "small"}, {"label": _("Big"), "value": "big"} - ], orientation='horizontal', stretch=False) + ], orientation='horizontal', compact=True) - grid0.addWidget(self.cursor_lbl, 38, 0) - grid0.addWidget(self.cursor_radio, 38, 1) + m_grid.addWidget(self.cursor_lbl, 0, 0) + m_grid.addWidget(self.cursor_radio, 0, 1) # Mouse Cursor Size self.cursor_size_lbl = FCLabel('%s:' % _('Cursor Size')) @@ -313,8 +340,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): self.cursor_size_entry.set_range(10, 70) self.cursor_size_entry.setWrapping(True) - grid0.addWidget(self.cursor_size_lbl, 40, 0) - grid0.addWidget(self.cursor_size_entry, 40, 1) + m_grid.addWidget(self.cursor_size_lbl, 2, 0) + m_grid.addWidget(self.cursor_size_entry, 2, 1) # Cursor Width self.cursor_width_lbl = FCLabel('%s:' % _('Cursor Width')) @@ -326,15 +353,15 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): self.cursor_width_entry.set_range(1, 10) self.cursor_width_entry.setWrapping(True) - grid0.addWidget(self.cursor_width_lbl, 42, 0) - grid0.addWidget(self.cursor_width_entry, 42, 1) + m_grid.addWidget(self.cursor_width_lbl, 4, 0) + m_grid.addWidget(self.cursor_width_entry, 4, 1) # Cursor Color Enable self.mouse_cursor_color_cb = FCCheckBox(label='%s' % _('Cursor Color')) self.mouse_cursor_color_cb.setToolTip( _("Check this box to color mouse cursor.") ) - grid0.addWidget(self.mouse_cursor_color_cb, 44, 0, 1, 2) + m_grid.addWidget(self.mouse_cursor_color_cb, 6, 0, 1, 2) # Cursor Color self.mouse_color_label = FCLabel('%s:' % _('Cursor Color')) @@ -343,8 +370,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): ) self.mouse_cursor_entry = FCColorEntry() - grid0.addWidget(self.mouse_color_label, 46, 0) - grid0.addWidget(self.mouse_cursor_entry, 46, 1) + m_grid.addWidget(self.mouse_color_label, 8, 0) + m_grid.addWidget(self.mouse_cursor_entry, 8, 1) self.mois = OptionalInputSection( self.mouse_cursor_color_cb, @@ -362,26 +389,33 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): "- RMB --> Right Mouse Button") ) self.pan_button_radio = RadioSet([{'label': _('MMB'), 'value': '3'}, - {'label': _('RMB'), 'value': '2'}]) + {'label': _('RMB'), 'value': '2'}], compact=True) - grid0.addWidget(self.panbuttonlabel, 48, 0) - grid0.addWidget(self.pan_button_radio, 48, 1) + m_grid.addWidget(self.panbuttonlabel, 10, 0) + m_grid.addWidget(self.pan_button_radio, 10, 1) # Multiple Selection Modifier Key - self.mselectlabel = FCLabel('%s:' % _('Multiple Selection')) + self.mselectlabel = FCLabel('%s:' % _('Multi-Selection')) self.mselectlabel.setToolTip( _("Select the key used for multiple selection.") ) self.mselect_radio = RadioSet([{'label': _('CTRL'), 'value': 'Control'}, - {'label': _('SHIFT'), 'value': 'Shift'}]) + {'label': _('SHIFT'), 'value': 'Shift'}], compact=True) - grid0.addWidget(self.mselectlabel, 50, 0) - grid0.addWidget(self.mselect_radio, 50, 1) + m_grid.addWidget(self.mselectlabel, 50, 0) + m_grid.addWidget(self.mselect_radio, 50, 1) - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 52, 0, 1, 2) + # ############################################################################################################# + # Parameters Frame + # ############################################################################################################# + self.par_label = FCLabel('%s:' % _('Parameters')) + self.layout.addWidget(self.par_label) + + par_frame = FCFrame() + self.layout.addWidget(par_frame) + + par_grid = FCGridLayout(v_spacing=5, h_spacing=3) + par_frame.setLayout(par_grid) # Delete confirmation self.delete_conf_cb = FCCheckBox(_('Delete object confirmation')) @@ -390,14 +424,14 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): "whenever the Delete object(s) event is triggered, either by\n" "menu shortcut or key shortcut.") ) - grid0.addWidget(self.delete_conf_cb, 54, 0, 1, 2) + par_grid.addWidget(self.delete_conf_cb, 0, 0, 1, 2) self.allow_edit_cb = FCCheckBox(_("Allow Edit")) self.allow_edit_cb.setToolTip( _("When checked, the user can edit the object names in the Project Tab\n" "by clicking on the object name. Active after restart.") ) - grid0.addWidget(self.allow_edit_cb, 56, 0, 1, 2) + par_grid.addWidget(self.allow_edit_cb, 2, 0, 1, 2) # Open behavior self.open_style_cb = FCCheckBox('%s' % _('"Open" behavior')) @@ -408,7 +442,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): "path for saving files or the path for opening files.") ) - grid0.addWidget(self.open_style_cb, 58, 0, 1, 2) + par_grid.addWidget(self.open_style_cb, 4, 0, 1, 2) # Enable/Disable ToolTips globally self.toggle_tooltips_cb = FCCheckBox(label=_('Enable ToolTips')) @@ -417,7 +451,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): "when hovering with mouse over items throughout the App.") ) - grid0.addWidget(self.toggle_tooltips_cb, 60, 0, 1, 2) + par_grid.addWidget(self.toggle_tooltips_cb, 6, 0, 1, 2) # Bookmarks Limit in the Help Menu self.bm_limit_spinner = FCSpinner() @@ -429,8 +463,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): "but the menu will hold only so much.") ) - grid0.addWidget(self.bm_limit_label, 62, 0) - grid0.addWidget(self.bm_limit_spinner, 62, 1) + par_grid.addWidget(self.bm_limit_label, 8, 0) + par_grid.addWidget(self.bm_limit_spinner, 8, 1) # Activity monitor icon self.activity_label = FCLabel('%s:' % _("Activity Icon")) @@ -440,8 +474,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): self.activity_combo = FCComboBox() self.activity_combo.addItems(['Ball black', 'Ball green', 'Arrow green', 'Eclipse green']) - grid0.addWidget(self.activity_label, 64, 0) - grid0.addWidget(self.activity_combo, 64, 1) + par_grid.addWidget(self.activity_label, 10, 0) + par_grid.addWidget(self.activity_combo, 10, 1) self.layout.addStretch() diff --git a/appGUI/preferences/general/GeneralAppPrefGroupUI.py b/appGUI/preferences/general/GeneralAppPrefGroupUI.py index d3c943da..e5b32013 100644 --- a/appGUI/preferences/general/GeneralAppPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralAppPrefGroupUI.py @@ -1,10 +1,9 @@ import sys -from PyQt6 import QtWidgets from PyQt6.QtCore import QSettings from appGUI.GUIElements import RadioSet, FCSpinner, FCCheckBox, FCComboBox, FCButton, OptionalInputSection, \ - FCDoubleSpinner, FCLabel, FCGridLayout, RadioSetDefaults + FCDoubleSpinner, FCLabel, FCGridLayout, RadioSetDefaults, FCFrame from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -16,6 +15,8 @@ if '_' not in builtins.__dict__: _ = gettext.gettext +# https://www.w3schools.com/colors/colors_names.asp +# Colors names class GeneralAppPrefGroupUI(OptionsGroupUI): def __init__(self, defaults, decimals=4, parent=None): super(GeneralAppPrefGroupUI, self).__init__(self, parent=parent) @@ -24,21 +25,28 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): self.decimals = decimals self.defaults = defaults - # Create a form layout for the Application general settings - grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - self.layout.addLayout(grid0) - - # Units for FlatCAM - self.unitslabel = FCLabel('%s:' % _('Units')) + # ############################################################################################################# + # Grid0 Frame + # ############################################################################################################# + self.unitslabel = FCLabel('%s' % _('Units')) self.unitslabel.setToolTip(_("The default value for the application units.\n" "Whatever is selected here is set every time\n" "FlatCAM is started.")) + self.layout.addWidget(self.unitslabel) + + grid0_frame = FCFrame() + self.layout.addWidget(grid0_frame) + + grid0 = FCGridLayout(v_spacing=5, h_spacing=3) + grid0_frame.setLayout(grid0) + + # Units for FlatCAM self.units_radio = RadioSetDefaults( - choices=[{'label': _('MM'), 'value': 'MM'}, {'label': _('IN'), 'value': 'IN'}] + choices=[{'label': _('mm'), 'value': 'MM'}, {'label': _('inch'), 'value': 'IN'}], + compact=True ) - grid0.addWidget(self.unitslabel, 0, 0) - grid0.addWidget(self.units_radio, 0, 1) + grid0.addWidget(self.units_radio, 0, 0, 1, 2) # Precision Metric self.precision_metric_label = FCLabel('%s:' % _('Precision MM')) @@ -68,6 +76,18 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.precision_inch_label, 4, 0) grid0.addWidget(self.precision_inch_entry, 4, 1) + self.par_label = FCLabel('%s' % _("Parameters")) + self.layout.addWidget(self.par_label) + + # ############################################################################################################# + # Parameters + # ############################################################################################################# + grid1_frame = FCFrame() + self.layout.addWidget(grid1_frame) + + grid1 = FCGridLayout(v_spacing=5, h_spacing=3) + grid1_frame.setLayout(grid1) + # Graphic Engine for FlatCAM self.ge_label = FCLabel('%s:' % _('Graphic Engine')) self.ge_label.setToolTip(_("Choose what graphic engine to use in FlatCAM.\n" @@ -76,141 +96,16 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): "Some graphic cards are too old and do not work in OpenGL(3D) mode, like:\n" "Intel HD3000 or older. In this case the plot area will be black therefore\n" "use the Legacy(2D) mode.")) - self.ge_radio = RadioSet([{'label': _('Legacy(2D)'), 'value': '2D'}, - {'label': _('OpenGL(3D)'), 'value': '3D'}], - orientation='vertical') + self.ge_radio = RadioSet([{'label': _('2D'), 'value': '2D'}, + {'label': _('3D'), 'value': '3D'}], compact=True) - grid0.addWidget(self.ge_label, 6, 0) - grid0.addWidget(self.ge_radio, 6, 1) + grid1.addWidget(self.ge_label, 0, 0) + grid1.addWidget(self.ge_radio, 0, 1) - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 8, 0, 1, 2) - - # Application Level for FlatCAM - self.app_level_label = FCLabel('%s:' % _('APPLICATION LEVEL')) - self.app_level_label.setToolTip(_("Choose the default level of usage for FlatCAM.\n" - "BASIC level -> reduced functionality, best for beginner's.\n" - "ADVANCED level -> full functionality.\n\n" - "The choice here will influence the parameters in\n" - "the Selected Tab for all kinds of FlatCAM objects.")) - grid0.addWidget(self.app_level_label, 10, 0, 1, 2) - - self.app_level_radio = RadioSet([{'label': _('Beginner'), 'value': 'b'}, - {'label': _('Advanced'), 'value': 'a'}]) - grid0.addWidget(self.app_level_radio, 12, 0, 1, 2) - - # Portability - self.portability_cb = FCCheckBox('%s' % _('Portable app')) - self.portability_cb.setToolTip(_("Choose if the application should run as portable.\n\n" - "If Checked the application will run portable,\n" - "which means that the preferences files will be saved\n" - "in the application folder, in the lib\\config subfolder.")) - - grid0.addWidget(self.portability_cb, 14, 0, 1, 2) - - # Verbose Log - self.verbose_cb = FCCheckBox('%s' % _('Verbose log')) - self.verbose_cb.setToolTip(_("Enable log messages in the Tcl Shell.\n" - "Require restart.")) - - grid0.addWidget(self.verbose_cb, 16, 0, 1, 2) - - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 18, 0, 1, 2) - - # Languages for FlatCAM - self.languagelabel = FCLabel('%s' % _('Languages')) - self.languagelabel.setToolTip(_("Set the language used throughout FlatCAM.")) - grid0.addWidget(self.languagelabel, 20, 0, 1, 2) - - self.language_combo = FCComboBox() - grid0.addWidget(self.language_combo, 22, 0, 1, 2) - self.language_combo.addItems(self.defaults["global_languages"]) - - self.language_apply_btn = FCButton(_("Apply Language")) - self.language_apply_btn.setToolTip(_("Set the language used throughout FlatCAM.\n" - "The app will restart after click.")) - - grid0.addWidget(self.language_apply_btn, 24, 0, 1, 2) - - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 26, 0, 1, 2) - - # ----------------------------------------------------------- - # ----------- APPLICATION STARTUP SETTINGS ------------------ - # ----------------------------------------------------------- - - self.startup_label = FCLabel('%s' % _('Startup Settings')) - grid0.addWidget(self.startup_label, 28, 0, 1, 2) - - # Splash Screen - self.splash_cb = FCCheckBox('%s' % _('Splash Screen')) - self.splash_cb.setToolTip( - _("Enable display of the splash screen at application startup.") - ) - - qsettings = QSettings("Open Source", "FlatCAM") - if qsettings.value("splash_screen"): - self.splash_cb.set_value(True) - else: - self.splash_cb.set_value(False) - - grid0.addWidget(self.splash_cb, 30, 0, 1, 2) - - # Sys Tray Icon - self.systray_cb = FCCheckBox('%s' % _('Sys Tray Icon')) - self.systray_cb.setToolTip( - _("Enable display of FlatCAM icon in Sys Tray.") - ) - grid0.addWidget(self.systray_cb, 32, 0, 1, 2) - - # Shell StartUp CB - self.shell_startup_cb = FCCheckBox(label='%s' % _('Show Shell')) - self.shell_startup_cb.setToolTip( - _("Check this box if you want the shell to\n" - "start automatically at startup.") - ) - - grid0.addWidget(self.shell_startup_cb, 34, 0, 1, 2) - - # Project at StartUp CB - self.project_startup_cb = FCCheckBox(label='%s' % _('Show Project')) - self.project_startup_cb.setToolTip( - _("Check this box if you want the project/selected/tool tab area to\n" - "to be shown automatically at startup.") - ) - grid0.addWidget(self.project_startup_cb, 36, 0, 1, 2) - - # Version Check CB - self.version_check_cb = FCCheckBox(label='%s' % _('Version Check')) - self.version_check_cb.setToolTip( - _("Check this box if you want to check\n" - "for a new version automatically at startup.") - ) - - grid0.addWidget(self.version_check_cb, 38, 0, 1, 2) - - # Send Stats CB - self.send_stats_cb = FCCheckBox(label='%s' % _('Send Statistics')) - self.send_stats_cb.setToolTip( - _("Check this box if you agree to send anonymous\n" - "stats automatically at startup, to help improve FlatCAM.") - ) - - grid0.addWidget(self.send_stats_cb, 40, 0, 1, 2) - - self.ois_version_check = OptionalInputSection(self.version_check_cb, [self.send_stats_cb]) - - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 42, 0, 1, 2) + # separator_line = QtWidgets.QFrame() + # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) + # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) + # grid0.addWidget(separator_line, 8, 0, 1, 2) # Worker Numbers self.worker_number_label = FCLabel('%s:' % _('Workers number')) @@ -225,8 +120,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): self.worker_number_sb = FCSpinner() self.worker_number_sb.set_range(2, 16) - grid0.addWidget(self.worker_number_label, 44, 0) - grid0.addWidget(self.worker_number_sb, 44, 1) + grid1.addWidget(self.worker_number_label, 2, 0) + grid1.addWidget(self.worker_number_sb, 2, 1) # Geometric tolerance tol_label = FCLabel('%s:' % _("Geo Tolerance")) @@ -242,17 +137,157 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): self.tol_entry.setSingleStep(0.001) self.tol_entry.set_precision(6) - grid0.addWidget(tol_label, 46, 0) - grid0.addWidget(self.tol_entry, 46, 1) + grid1.addWidget(tol_label, 4, 0) + grid1.addWidget(self.tol_entry, 4, 1) - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 48, 0, 1, 2) + # Portability + self.portability_cb = FCCheckBox('%s' % _('Portable app')) + self.portability_cb.setToolTip(_("Choose if the application should run as portable.\n\n" + "If Checked the application will run portable,\n" + "which means that the preferences files will be saved\n" + "in the application folder, in the lib\\config subfolder.")) + + grid1.addWidget(self.portability_cb, 6, 0, 1, 2) + + # Verbose Log + self.verbose_cb = FCCheckBox('%s' % _('Verbose log')) + self.verbose_cb.setToolTip(_("Enable log messages in the Tcl Shell.\n" + "Require restart.")) + + grid1.addWidget(self.verbose_cb, 8, 0, 1, 2) + + # ############################################################################################################# + # Grid0 Frame + # ############################################################################################################# + self.app_level_label = FCLabel('%s' % _('Application Level')) + self.app_level_label.setToolTip(_("Choose the default level of usage for FlatCAM.\n" + "BASIC level -> reduced functionality, best for beginner's.\n" + "ADVANCED level -> full functionality.\n\n" + "The choice here will influence the parameters in\n" + "the Selected Tab for all kinds of FlatCAM objects.")) + self.layout.addWidget(self.app_level_label) + + grid2_frame = FCFrame() + self.layout.addWidget(grid2_frame) + + grid2 = FCGridLayout(v_spacing=5, h_spacing=3) + grid2_frame.setLayout(grid2) + + # Application Level for FlatCAM + self.app_level_radio = RadioSet([{'label': _('Beginner'), 'value': 'b'}, + {'label': _('Advanced'), 'value': 'a'}], compact=True) + grid2.addWidget(self.app_level_radio, 2, 0, 1, 2) + + # ############################################################################################################# + # Grid3 Frame + # ############################################################################################################# + # Languages for FlatCAM + self.languagelabel = FCLabel('%s' % _('Languages')) + self.languagelabel.setToolTip(_("Set the language used throughout FlatCAM.")) + self.layout.addWidget(self.languagelabel) + + grid3_frame = FCFrame() + self.layout.addWidget(grid3_frame) + + grid3 = FCGridLayout(v_spacing=5, h_spacing=3) + grid3_frame.setLayout(grid3) + + self.language_combo = FCComboBox() + self.language_combo.addItems(self.defaults["global_languages"]) + grid3.addWidget(self.language_combo, 0, 0, 1, 2) + + self.language_apply_btn = FCButton(_("Apply Language")) + self.language_apply_btn.setToolTip(_("Set the language used throughout FlatCAM.\n" + "The app will restart after click.")) + + grid3.addWidget(self.language_apply_btn, 2, 0, 1, 2) + + # ----------------------------------------------------------- + # ----------- APPLICATION STARTUP SETTINGS ------------------ + # ----------------------------------------------------------- + + self.startup_label = FCLabel('%s' % _('Startup Settings')) + self.layout.addWidget(self.startup_label) + + # ############################################################################################################# + # Grid4 Frame + # ############################################################################################################# + grid4_frame = FCFrame() + self.layout.addWidget(grid4_frame) + + grid4 = FCGridLayout(v_spacing=5, h_spacing=3) + grid4_frame.setLayout(grid4) + + # Splash Screen + self.splash_cb = FCCheckBox('%s' % _('Splash Screen')) + self.splash_cb.setToolTip( + _("Enable display of the splash screen at application startup.") + ) + + qsettings = QSettings("Open Source", "FlatCAM") + if qsettings.value("splash_screen"): + self.splash_cb.set_value(True) + else: + self.splash_cb.set_value(False) + + grid4.addWidget(self.splash_cb, 0, 0, 1, 2) + + # Sys Tray Icon + self.systray_cb = FCCheckBox('%s' % _('Sys Tray Icon')) + self.systray_cb.setToolTip( + _("Enable display of FlatCAM icon in Sys Tray.") + ) + grid4.addWidget(self.systray_cb, 2, 0, 1, 2) + + # Shell StartUp CB + self.shell_startup_cb = FCCheckBox(label='%s' % _('Show Shell')) + self.shell_startup_cb.setToolTip( + _("Check this box if you want the shell to\n" + "start automatically at startup.") + ) + + grid4.addWidget(self.shell_startup_cb, 4, 0, 1, 2) + + # Project at StartUp CB + self.project_startup_cb = FCCheckBox(label='%s' % _('Show Project')) + self.project_startup_cb.setToolTip( + _("Check this box if you want the project/selected/tool tab area to\n" + "to be shown automatically at startup.") + ) + grid4.addWidget(self.project_startup_cb, 6, 0, 1, 2) + + # Version Check CB + self.version_check_cb = FCCheckBox(label='%s' % _('Version Check')) + self.version_check_cb.setToolTip( + _("Check this box if you want to check\n" + "for a new version automatically at startup.") + ) + + grid4.addWidget(self.version_check_cb, 8, 0, 1, 2) + + # Send Stats CB + self.send_stats_cb = FCCheckBox(label='%s' % _('Send Statistics')) + self.send_stats_cb.setToolTip( + _("Check this box if you agree to send anonymous\n" + "stats automatically at startup, to help improve FlatCAM.") + ) + + grid4.addWidget(self.send_stats_cb, 10, 0, 1, 2) + + self.ois_version_check = OptionalInputSection(self.version_check_cb, [self.send_stats_cb]) # Save Settings - self.save_label = FCLabel('%s' % _("Save Settings")) - grid0.addWidget(self.save_label, 50, 0, 1, 2) + self.save_label = FCLabel('%s' % _("Save Settings")) + self.layout.addWidget(self.save_label) + + # ############################################################################################################# + # Grid6 Frame + # ############################################################################################################# + grid6_frame = FCFrame() + self.layout.addWidget(grid6_frame) + + grid6 = FCGridLayout(v_spacing=5, h_spacing=3) + grid6_frame.setLayout(grid6) # Save compressed project CB self.save_type_cb = FCCheckBox(_('Save Compressed Project')) @@ -261,7 +296,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): "When checked it will save a compressed FlatCAM project.") ) - grid0.addWidget(self.save_type_cb, 52, 0, 1, 2) + grid6.addWidget(self.save_type_cb, 0, 0, 1, 2) # Project LZMA Comppression Level self.compress_spinner = FCSpinner() @@ -273,8 +308,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): "but require more RAM usage and more processing time.") ) - grid0.addWidget(self.compress_label, 54, 0) - grid0.addWidget(self.compress_spinner, 54, 1) + grid6.addWidget(self.compress_label, 2, 0) + grid6.addWidget(self.compress_spinner, 2, 1) self.proj_ois = OptionalInputSection(self.save_type_cb, [self.compress_label, self.compress_spinner], True) @@ -286,7 +321,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): "at the set interval.") ) - grid0.addWidget(self.autosave_cb, 56, 0, 1, 2) + grid6.addWidget(self.autosave_cb, 4, 0, 1, 2) # Auto Save Timeout Interval self.autosave_entry = FCSpinner() @@ -299,21 +334,25 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): "While active, some operations may block this feature.") ) - grid0.addWidget(self.autosave_label, 58, 0) - grid0.addWidget(self.autosave_entry, 58, 1) + grid6.addWidget(self.autosave_label, 6, 0) + grid6.addWidget(self.autosave_entry, 6, 1) # self.as_ois = OptionalInputSection(self.autosave_cb, [self.autosave_label, self.autosave_entry], True) - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 60, 0, 1, 2) - - self.pdf_param_label = FCLabel('%s:' % _("Text to PDF parameters")) + self.pdf_param_label = FCLabel('%s' % _("Text to PDF parameters")) self.pdf_param_label.setToolTip( _("Used when saving text in Code Editor or in FlatCAM Document objects.") ) - grid0.addWidget(self.pdf_param_label, 62, 0, 1, 2) + self.layout.addWidget(self.pdf_param_label) + + # ############################################################################################################# + # Grid7 Frame + # ############################################################################################################# + grid7_frame = FCFrame() + self.layout.addWidget(grid7_frame) + + grid7 = FCGridLayout(v_spacing=5, h_spacing=3) + grid7_frame.setLayout(grid7) # Top Margin value self.tmargin_entry = FCDoubleSpinner() @@ -325,8 +364,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): _("Distance between text body and the top of the PDF file.") ) - grid0.addWidget(self.tmargin_label, 64, 0) - grid0.addWidget(self.tmargin_entry, 64, 1) + grid7.addWidget(self.tmargin_label, 0, 0) + grid7.addWidget(self.tmargin_entry, 0, 1) # Bottom Margin value self.bmargin_entry = FCDoubleSpinner() @@ -338,8 +377,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): _("Distance between text body and the bottom of the PDF file.") ) - grid0.addWidget(self.bmargin_label, 66, 0) - grid0.addWidget(self.bmargin_entry, 66, 1) + grid7.addWidget(self.bmargin_label, 2, 0) + grid7.addWidget(self.bmargin_entry, 2, 1) # Left Margin value self.lmargin_entry = FCDoubleSpinner() @@ -351,8 +390,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): _("Distance between text body and the left of the PDF file.") ) - grid0.addWidget(self.lmargin_label, 68, 0) - grid0.addWidget(self.lmargin_entry, 68, 1) + grid7.addWidget(self.lmargin_label, 4, 0) + grid7.addWidget(self.lmargin_entry, 4, 1) # Right Margin value self.rmargin_entry = FCDoubleSpinner() @@ -364,11 +403,13 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): _("Distance between text body and the right of the PDF file.") ) - grid0.addWidget(self.rmargin_label, 70, 0) - grid0.addWidget(self.rmargin_entry, 70, 1) + grid7.addWidget(self.rmargin_label, 6, 0) + grid7.addWidget(self.rmargin_entry, 6, 1) self.layout.addStretch() + FCGridLayout.set_common_column_size([grid0, grid1, grid6, grid7], 0) + if sys.platform != 'win32': self.portability_cb.hide() diff --git a/appGUI/preferences/general/GeneralAppSettingsGroupUI.py b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py index a7c8105a..c9d29e28 100644 --- a/appGUI/preferences/general/GeneralAppSettingsGroupUI.py +++ b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py @@ -86,7 +86,7 @@ class GeneralAppSettingsGroupUI(OptionsGroupUI2): self.textbox_font_size_field = self.option_dict()["textbox_font_size"].get_field() if qsettings.contains("textbox_font_size"): - self.textbox_font_size_field.set_value(settings.value('textbox_font_size', type=int)) + self.textbox_font_size_field.set_value(qsettings.value('textbox_font_size', type=int)) else: self.textbox_font_size_field.set_value(10) @@ -120,7 +120,7 @@ class GeneralAppSettingsGroupUI(OptionsGroupUI2): def build_options(self) -> [OptionUI]: return [ - HeadingOptionUI(label_text="Grid Settings", label_tooltip=None), + HeadingOptionUI(label_text="Grid Settings", color="brown", label_tooltip=None), DoubleSpinnerOptionUI( option="global_gridx", label_text="X value", diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index 16671bac..8b6b0601 100644 --- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -2,7 +2,7 @@ from PyQt6 import QtWidgets, QtCore from PyQt6.QtCore import QSettings from appGUI.GUIElements import RadioSet, FCCheckBox, FCComboBox, FCSliderWithSpinner, FCColorEntry, FCLabel, \ - FCGridLayout + FCGridLayout, FCFrame from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -22,9 +22,17 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): self.decimals = decimals self.defaults = defaults - # Create a grid layout for the Application general settings + self.param_lbl = FCLabel('%s' % _("Parameters")) + self.layout.addWidget(self.param_lbl) + + # ############################################################################################################# + # Grid0 Frame + # ############################################################################################################# + par_frame = FCFrame() + self.layout.addWidget(par_frame) + grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - self.layout.addLayout(grid0) + par_frame.setLayout(grid0) # Theme selection self.theme_label = FCLabel('%s:' % _('Theme')) @@ -36,7 +44,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): self.theme_radio = RadioSet([ {"label": _("Light"), "value": "white"}, {"label": _("Dark"), "value": "black"} - ], orientation='vertical') + ], compact=True) grid0.addWidget(self.theme_label, 0, 0) grid0.addWidget(self.theme_radio, 0, 1) @@ -48,7 +56,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): "a lighter (gray) color. To be used when a\n" "full dark theme is applied.") ) - grid0.addWidget(self.gray_icons_cb, 1, 0, 1, 3) + grid0.addWidget(self.gray_icons_cb, 2, 0, 1, 3) # self.theme_button = FCButton(_("Apply Theme")) # self.theme_button.setToolTip( @@ -61,7 +69,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 3, 0, 1, 2) + grid0.addWidget(separator_line, 4, 0, 1, 2) # Layout selection self.layout_label = FCLabel('%s:' % _('Layout')) @@ -75,8 +83,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): self.layout_combo.addItem("compact") self.layout_combo.addItem("minimal") - grid0.addWidget(self.layout_label, 4, 0) - grid0.addWidget(self.layout_combo, 4, 1) + grid0.addWidget(self.layout_label, 6, 0) + grid0.addWidget(self.layout_combo, 6, 1) # Set the current index for layout_combo qsettings = QSettings("Open Source", "FlatCAM") @@ -99,8 +107,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): self.style_combo.setCurrentIndex(index) self.style_combo.activated.connect(self.handle_style) - grid0.addWidget(self.style_label, 5, 0) - grid0.addWidget(self.style_combo, 5, 1) + grid0.addWidget(self.style_label, 8, 0) + grid0.addWidget(self.style_combo, 8, 1) # Enable Hover box self.hover_cb = FCCheckBox('%s' % _('Hover Shape')) @@ -109,7 +117,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): "It is displayed whenever the mouse cursor is hovering\n" "over any kind of not-selected object.") ) - grid0.addWidget(self.hover_cb, 8, 0, 1, 3) + grid0.addWidget(self.hover_cb, 10, 0, 1, 3) # Enable Selection box self.selection_cb = FCCheckBox('%s' % _('Selection Shape')) @@ -119,16 +127,23 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): "either by clicking or dragging mouse from left to right or\n" "right to left.") ) - grid0.addWidget(self.selection_cb, 9, 0, 1, 3) + grid0.addWidget(self.selection_cb, 12, 0, 1, 3) - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 14, 0, 1, 2) + # ############################################################################################################# + # Grid1 Frame + # ############################################################################################################# + self.color_lbl = FCLabel('%s' % _("Colors")) + self.layout.addWidget(self.color_lbl) + + color_frame = FCFrame() + self.layout.addWidget(color_frame) + + grid1 = FCGridLayout(v_spacing=5, h_spacing=3) + color_frame.setLayout(grid1) # Plot Selection (left - right) Color self.sel_lr_label = FCLabel('%s' % _('Left-Right Selection Color')) - grid0.addWidget(self.sel_lr_label, 15, 0, 1, 2) + grid1.addWidget(self.sel_lr_label, 0, 0, 1, 2) self.sl_color_label = FCLabel('%s:' % _('Outline')) self.sl_color_label.setToolTip( @@ -136,8 +151,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.sl_color_entry = FCColorEntry() - grid0.addWidget(self.sl_color_label, 16, 0) - grid0.addWidget(self.sl_color_entry, 16, 1) + grid1.addWidget(self.sl_color_label, 2, 0) + grid1.addWidget(self.sl_color_entry, 2, 1) self.sf_color_label = FCLabel('%s:' % _('Fill')) self.sf_color_label.setToolTip( @@ -148,8 +163,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.sf_color_entry = FCColorEntry() - grid0.addWidget(self.sf_color_label, 17, 0) - grid0.addWidget(self.sf_color_entry, 17, 1) + grid1.addWidget(self.sf_color_label, 4, 0) + grid1.addWidget(self.sf_color_entry, 4, 1) # Plot Selection (left - right) Fill Transparency Level self.left_right_alpha_label = FCLabel('%s:' % _('Alpha')) @@ -158,17 +173,17 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.left_right_alpha_entry = FCSliderWithSpinner(0, 255, 1) - grid0.addWidget(self.left_right_alpha_label, 18, 0) - grid0.addWidget(self.left_right_alpha_entry, 18, 1) + grid1.addWidget(self.left_right_alpha_label, 6, 0) + grid1.addWidget(self.left_right_alpha_entry, 6, 1) separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 19, 0, 1, 2) + grid1.addWidget(separator_line, 8, 0, 1, 2) # Plot Selection (left - right) Color self.sel_rl_label = FCLabel('%s' % _('Right-Left Selection Color')) - grid0.addWidget(self.sel_rl_label, 20, 0, 1, 2) + grid1.addWidget(self.sel_rl_label, 10, 0, 1, 2) # Plot Selection (right - left) Line Color self.alt_sl_color_label = FCLabel('%s:' % _('Outline')) @@ -177,8 +192,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.alt_sl_color_entry = FCColorEntry() - grid0.addWidget(self.alt_sl_color_label, 21, 0) - grid0.addWidget(self.alt_sl_color_entry, 21, 1) + grid1.addWidget(self.alt_sl_color_label, 12, 0) + grid1.addWidget(self.alt_sl_color_entry, 12, 1) # Plot Selection (right - left) Fill Color self.alt_sf_color_label = FCLabel('%s:' % _('Fill')) @@ -190,8 +205,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.alt_sf_color_entry = FCColorEntry() - grid0.addWidget(self.alt_sf_color_label, 22, 0) - grid0.addWidget(self.alt_sf_color_entry, 22, 1) + grid1.addWidget(self.alt_sf_color_label, 14, 0) + grid1.addWidget(self.alt_sf_color_entry, 14, 1) # Plot Selection (right - left) Fill Transparency Level self.right_left_alpha_label = FCLabel('%s:' % _('Alpha')) @@ -200,20 +215,20 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.right_left_alpha_entry = FCSliderWithSpinner(0, 255, 1) - grid0.addWidget(self.right_left_alpha_label, 23, 0) - grid0.addWidget(self.right_left_alpha_entry, 23, 1) + grid1.addWidget(self.right_left_alpha_label, 16, 0) + grid1.addWidget(self.right_left_alpha_entry, 16, 1) separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 24, 0, 1, 2) + grid1.addWidget(separator_line, 18, 0, 1, 2) # ------------------------------------------------------------------ # ----------------------- Editor Color ----------------------------- # ------------------------------------------------------------------ self.editor_color_label = FCLabel('%s' % _('Editor Color')) - grid0.addWidget(self.editor_color_label, 25, 0, 1, 2) + grid1.addWidget(self.editor_color_label, 20, 0, 1, 2) # Editor Draw Color self.draw_color_label = FCLabel('%s:' % _('Drawing')) @@ -222,8 +237,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.draw_color_entry = FCColorEntry() - grid0.addWidget(self.draw_color_label, 26, 0) - grid0.addWidget(self.draw_color_entry, 26, 1) + grid1.addWidget(self.draw_color_label, 22, 0) + grid1.addWidget(self.draw_color_entry, 22, 1) # Editor Draw Selection Color self.sel_draw_color_label = FCLabel('%s:' % _('Selection')) @@ -232,20 +247,20 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.sel_draw_color_entry = FCColorEntry() - grid0.addWidget(self.sel_draw_color_label, 27, 0) - grid0.addWidget(self.sel_draw_color_entry, 27, 1) + grid1.addWidget(self.sel_draw_color_label, 24, 0) + grid1.addWidget(self.sel_draw_color_entry, 24, 1) separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 28, 0, 1, 2) + grid1.addWidget(separator_line, 26, 0, 1, 2) # ------------------------------------------------------------------ # ----------------------- Project Settings ----------------------------- # ------------------------------------------------------------------ self.proj_settings_label = FCLabel('%s' % _('Project Items Color')) - grid0.addWidget(self.proj_settings_label, 29, 0, 1, 2) + grid1.addWidget(self.proj_settings_label, 28, 0, 1, 2) # Project Tab items color self.proj_color_label = FCLabel('%s:' % _('Enabled')) @@ -254,8 +269,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.proj_color_entry = FCColorEntry() - grid0.addWidget(self.proj_color_label, 30, 0) - grid0.addWidget(self.proj_color_entry, 30, 1) + grid1.addWidget(self.proj_color_label, 30, 0) + grid1.addWidget(self.proj_color_entry, 30, 1) self.proj_color_dis_label = FCLabel('%s:' % _('Disabled')) self.proj_color_dis_label.setToolTip( @@ -264,8 +279,10 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.proj_color_dis_entry = FCColorEntry() - grid0.addWidget(self.proj_color_dis_label, 31, 0) - grid0.addWidget(self.proj_color_dis_entry, 31, 1) + grid1.addWidget(self.proj_color_dis_label, 32, 0) + grid1.addWidget(self.proj_color_dis_entry, 32, 1) + + FCGridLayout.set_common_column_size([grid0, grid1], 0) # Project autohide CB self.project_autohide_cb = FCCheckBox(label=_('Project AutoHide')) @@ -275,10 +292,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): "to show whenever a new object is created.") ) - grid0.addWidget(self.project_autohide_cb, 32, 0, 1, 2) - - # Just to add empty rows - grid0.addWidget(FCLabel(''), 33, 0, 1, 2) + self.layout.addWidget(self.project_autohide_cb) self.layout.addStretch() diff --git a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py index 53a05a6d..b4dd1537 100644 --- a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py @@ -85,7 +85,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): {'label': _('MetaHeuristic'), 'value': 'M'}, {'label': _('Basic'), 'value': 'B'}, {'label': _('TSA'), 'value': 'T'} - ], orientation='vertical', stretch=False) + ], orientation='vertical', compact=True) grid0.addWidget(self.opt_algorithm_label, 12, 0) grid0.addWidget(self.opt_algorithm_radio, 12, 1) diff --git a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py index f02f7554..67071ad3 100644 --- a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py @@ -110,7 +110,7 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): self.bbox_type_radio = RadioSet([ {'label': _('Rectangular'), 'value': 'rect'}, {"label": _("Minimal"), "value": "min"} - ], stretch=False) + ], compact=True) self.bbox_type_label = FCLabel('%s:' % _("Box Type")) self.bbox_type_label.setToolTip( _("- 'Rectangular' - the bounding box will be of rectangular shape.\n" diff --git a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py index 8bebd33a..90601823 100644 --- a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py @@ -39,7 +39,7 @@ class Tools2CalPrefGroupUI(OptionsGroupUI): "- Free -> click freely on canvas to acquire the calibration points")) self.cal_source_radio = RadioSet([{'label': _('Object'), 'value': 'object'}, {'label': _('Free'), 'value': 'free'}], - stretch=False) + compact=True) grid_lay.addWidget(self.cal_source_lbl, 1, 0) grid_lay.addWidget(self.cal_source_radio, 1, 1, 1, 2) diff --git a/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py b/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py index 5dcd9967..81c7e21c 100644 --- a/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py @@ -93,7 +93,7 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI): {'label': _("Proportional"), 'value': 'prop'} ], orientation='vertical', - stretch=False) + compact=True) self.method_label = FCLabel('%s:' % _("Method")) self.method_label.setToolTip( _("The method for processing pads. Can be:\n" diff --git a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py index 7e2d314d..b7d53408 100644 --- a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py @@ -71,7 +71,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): {'label': _('Up'), 'value': 'up'}, {"label": _("Down"), "value": "down"}, {"label": _("None"), "value": "no"} - ], stretch=False) + ], compact=True) self.pos_label = FCLabel('%s:' % _("Second fiducial")) self.pos_label.setToolTip( _("The position for the second fiducial.\n" @@ -132,7 +132,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): self.mode_radio = RadioSet([ {'label': _('Auto'), 'value': 'auto'}, {"label": _("Manual"), "value": "manual"} - ], stretch=False) + ], compact=True) self.mode_label = FCLabel('%s:' % _("Mode")) self.mode_label.setToolTip( _("- 'Auto' - automatic placement of fiducials in the corners of the bounding box.\n" diff --git a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py index f5e0cdd7..33614115 100644 --- a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py @@ -59,7 +59,7 @@ class Tools2InvertPrefGroupUI(OptionsGroupUI): {'label': _('Rounded'), 'value': 'r'}, {'label': _('Square'), 'value': 's'}, {'label': _('Bevel'), 'value': 'b'} - ], orientation='vertical', stretch=False) + ], orientation='vertical', compact=True) grid0.addWidget(self.join_label, 5, 0, 1, 2) grid0.addWidget(self.join_radio, 7, 0, 1, 2) diff --git a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py index ee9a7d7d..a7e88dbc 100644 --- a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py @@ -94,7 +94,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): {'label': _("Proportional"), 'value': 'prop'} ], orientation='vertical', - stretch=False) + compact=True) self.hole_size_label = FCLabel('%s:' % _("Method")) self.hole_size_label.setToolTip( _("The punch hole source can be:\n" diff --git a/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py index cee07f6e..1b3d0111 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, FCGridLayout +from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel, FCGridLayout, FCFrame from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -22,15 +22,21 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI): self.defaults = defaults # ## Board cuttout - self.dblsided_label = FCLabel("%s:" % _("Parameters")) + self.dblsided_label = FCLabel('%s' % _("PCB Alignment")) self.dblsided_label.setToolTip( _("A tool to help in creating a double sided\n" "PCB using alignment holes.") ) self.layout.addWidget(self.dblsided_label) - grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - self.layout.addLayout(grid0) + # ############################################################################################################# + # Parameters Frame + # ############################################################################################################# + par_frame = FCFrame() + self.layout.addWidget(par_frame) + + param_grid = FCGridLayout(v_spacing=5, h_spacing=3) + par_frame.setLayout(param_grid) # ## Drill diameter for alignment holes self.drill_dia_entry = FCDoubleSpinner() @@ -43,8 +49,8 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI): _("Diameter of the drill for the " "alignment holes.") ) - grid0.addWidget(self.dd_label, 0, 0) - grid0.addWidget(self.drill_dia_entry, 0, 1) + param_grid.addWidget(self.dd_label, 0, 0) + param_grid.addWidget(self.drill_dia_entry, 0, 1) # ## Alignment Axis self.align_ax_label = FCLabel('%s:' % _("Align Axis")) @@ -52,26 +58,39 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI): _("Mirror vertically (X) or horizontally (Y).") ) self.align_axis_radio = RadioSet([{'label': 'X', 'value': 'X'}, - {'label': 'Y', 'value': 'Y'}]) + {'label': 'Y', 'value': 'Y'}], compact=True) - grid0.addWidget(self.align_ax_label, 1, 0) - grid0.addWidget(self.align_axis_radio, 1, 1) + param_grid.addWidget(self.align_ax_label, 1, 0) + param_grid.addWidget(self.align_axis_radio, 1, 1) # ## Axis self.mirror_axis_radio = RadioSet([{'label': 'X', 'value': 'X'}, - {'label': 'Y', 'value': 'Y'}]) + {'label': 'Y', 'value': 'Y'}], compact=True) self.mirax_label = FCLabel('%s:' % _("Mirror Axis")) self.mirax_label.setToolTip( _("Mirror vertically (X) or horizontally (Y).") ) - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 2, 0, 1, 2) + # separator_line = QtWidgets.QFrame() + # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) + # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) + # param_grid.addWidget(separator_line, 2, 0, 1, 2) - grid0.addWidget(self.mirax_label, 3, 0) - grid0.addWidget(self.mirror_axis_radio, 3, 1) + # ############################################################################################################# + # Mirror Frame + # ############################################################################################################# + # ### Tools ## ## + self.mirror_label = FCLabel('%s' % _("Mirror Operation")) + self.layout.addWidget(self.mirror_label) + + mirror_frame = FCFrame() + self.layout.addWidget(mirror_frame) + + mirror_grid = FCGridLayout(v_spacing=5, h_spacing=3) + mirror_frame.setLayout(mirror_grid) + + mirror_grid.addWidget(self.mirax_label, 0, 0) + mirror_grid.addWidget(self.mirror_axis_radio, 0, 1) # ## Axis Location self.axis_location_radio = RadioSet( @@ -79,7 +98,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI): {'label': _('Point'), 'value': 'point'}, {'label': _('Box'), 'value': 'box'}, {'label': _('Snap'), 'value': 'hole'}, - ] + ], compact=True ) self.axloc_label = FCLabel('%s:' % _("Axis Ref")) self.axloc_label.setToolTip( @@ -91,7 +110,9 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI): "- Snap-> a point defined by the center of a drill hone in a Excellon object") ) - grid0.addWidget(self.axloc_label, 4, 0) - grid0.addWidget(self.axis_location_radio, 4, 1) + mirror_grid.addWidget(self.axloc_label, 2, 0) + mirror_grid.addWidget(self.axis_location_radio, 2, 1) - self.layout.addStretch() + FCGridLayout.set_common_column_size([param_grid, mirror_grid], 0) + + # self.layout.addStretch(1) diff --git a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py index f76b5a85..59420d2f 100644 --- a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py @@ -41,7 +41,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): # Scale Geometry self.film_scale_cb = FCCheckBox('%s' % _("Scale")) self.film_scale_cb.setToolTip( - _("A value greater than 1 will stretch the film\n" + _("A value greater than 1 will compact the film\n" "while a value less than 1 will jolt it.") ) self.film_scale_cb.setStyleSheet( @@ -157,7 +157,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): self.film_mirror_axis = RadioSet([{'label': _('X'), 'value': 'x'}, {'label': _('Y'), 'value': 'y'}, {'label': _('Both'), 'value': 'both'}], - stretch=False) + compact=True) self.film_mirror_axis_label = FCLabel('%s:' % _("Mirror Axis")) adj_grid.addWidget(self.film_mirror_axis_label, 12, 0) @@ -209,7 +209,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): # Polarity self.film_type_radio = RadioSet([{'label': 'Pos', 'value': 'pos'}, - {'label': 'Neg', 'value': 'neg'}]) + {'label': 'Neg', 'value': 'neg'}], compact=True) ftypelbl = FCLabel('%s:' % _('Polarity')) ftypelbl.setToolTip( _("Generate a Positive black film or a Negative film.") @@ -265,7 +265,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): self.file_type_radio = RadioSet([{'label': _('SVG'), 'value': 'svg'}, {'label': _('PNG'), 'value': 'png'}, {'label': _('PDF'), 'value': 'pdf'} - ], stretch=False) + ], compact=True) self.file_type_label = FCLabel('%s:' % _("Film Type")) self.file_type_label.setToolTip( @@ -285,7 +285,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): self.orientation_radio = RadioSet([{'label': _('Portrait'), 'value': 'p'}, {'label': _('Landscape'), 'value': 'l'}, - ], stretch=False) + ], compact=True) grid_par.addWidget(self.orientation_label, 14, 0) grid_par.addWidget(self.orientation_radio, 14, 1) diff --git a/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py b/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py index 7cc904dd..441737d0 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, FCGridLayout +from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCLabel, FCComboBox, FCGridLayout, FCFrame from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -22,15 +22,20 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): self.defaults = defaults # ## Board cuttout - self.levelling_label = FCLabel("%s:" % _("Parameters")) + self.levelling_label = FCLabel('%s' % _("Parameters")) self.levelling_label.setToolTip( _("Generate CNC Code with auto-levelled paths.") ) self.layout.addWidget(self.levelling_label) - # Grid Layout - grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - self.layout.addLayout(grid0) + # ############################################################################################################# + # Parameters Frame + # ############################################################################################################# + par_frame = FCFrame() + self.layout.addWidget(par_frame) + + par_grid = FCGridLayout(v_spacing=5, h_spacing=3) + par_frame.setLayout(par_grid) # Probe points mode al_mode_lbl = FCLabel('%s:' % _("Mode")) @@ -43,8 +48,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): {'label': _('Manual'), 'value': 'manual'}, {'label': _('Grid'), 'value': 'grid'} ]) - grid0.addWidget(al_mode_lbl, 8, 0) - grid0.addWidget(self.al_mode_radio, 8, 1) + par_grid.addWidget(al_mode_lbl, 8, 0) + par_grid.addWidget(self.al_mode_radio, 8, 1) # AUTOLEVELL METHOD self.al_method_lbl = FCLabel('%s:' % _("Method")) @@ -57,8 +62,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): {'label': _('Voronoi'), 'value': 'v'}, {'label': _('Bilinear'), 'value': 'b'} ]) - grid0.addWidget(self.al_method_lbl, 9, 0) - grid0.addWidget(self.al_method_radio, 9, 1) + par_grid.addWidget(self.al_method_lbl, 9, 0) + par_grid.addWidget(self.al_method_radio, 9, 1) # ## Columns self.al_columns_entry = FCSpinner() @@ -67,8 +72,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): self.al_columns_label.setToolTip( _("The number of grid columns.") ) - grid0.addWidget(self.al_columns_label, 10, 0) - grid0.addWidget(self.al_columns_entry, 10, 1) + par_grid.addWidget(self.al_columns_label, 10, 0) + par_grid.addWidget(self.al_columns_entry, 10, 1) # ## Rows self.al_rows_entry = FCSpinner() @@ -77,8 +82,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): self.al_rows_label.setToolTip( _("The number of grid rows.") ) - grid0.addWidget(self.al_rows_label, 12, 0) - grid0.addWidget(self.al_rows_entry, 12, 1) + par_grid.addWidget(self.al_rows_label, 12, 0) + par_grid.addWidget(self.al_rows_entry, 12, 1) # Travel Z Probe self.ptravelz_label = FCLabel('%s:' % _("Probe Z travel")) @@ -89,8 +94,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): self.ptravelz_entry.set_precision(self.decimals) self.ptravelz_entry.set_range(0.0000, 10000.0000) - grid0.addWidget(self.ptravelz_label, 14, 0) - grid0.addWidget(self.ptravelz_entry, 14, 1) + par_grid.addWidget(self.ptravelz_label, 14, 0) + par_grid.addWidget(self.ptravelz_entry, 14, 1) # Probe depth self.pdepth_label = FCLabel('%s:' % _("Probe Z depth")) @@ -102,8 +107,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): self.pdepth_entry.set_precision(self.decimals) self.pdepth_entry.set_range(-910000.0000, 0.0000) - grid0.addWidget(self.pdepth_label, 16, 0) - grid0.addWidget(self.pdepth_entry, 16, 1) + par_grid.addWidget(self.pdepth_label, 16, 0) + par_grid.addWidget(self.pdepth_entry, 16, 1) # Probe feedrate self.feedrate_probe_label = FCLabel('%s:' % _("Probe Feedrate")) @@ -114,13 +119,13 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): self.feedrate_probe_entry.set_precision(self.decimals) self.feedrate_probe_entry.set_range(0, 910000.0000) - grid0.addWidget(self.feedrate_probe_label, 18, 0) - grid0.addWidget(self.feedrate_probe_entry, 18, 1) + par_grid.addWidget(self.feedrate_probe_label, 18, 0) + par_grid.addWidget(self.feedrate_probe_entry, 18, 1) separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 20, 0, 1, 2) + par_grid.addWidget(separator_line, 20, 0, 1, 2) self.al_controller_label = FCLabel('%s:' % _("Controller")) self.al_controller_label.setToolTip( @@ -130,8 +135,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): self.al_controller_combo = FCComboBox() self.al_controller_combo.addItems(["MACH3", "MACH4", "LinuxCNC", "GRBL"]) - grid0.addWidget(self.al_controller_label, 22, 0) - grid0.addWidget(self.al_controller_combo, 22, 1) + par_grid.addWidget(self.al_controller_label, 22, 0) + par_grid.addWidget(self.al_controller_combo, 22, 1) # JOG Step self.jog_step_label = FCLabel('%s:' % _("Step")) @@ -143,8 +148,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): self.jog_step_entry.set_precision(self.decimals) self.jog_step_entry.set_range(0, 910000.0000) - grid0.addWidget(self.jog_step_label, 24, 0) - grid0.addWidget(self.jog_step_entry, 24, 1) + par_grid.addWidget(self.jog_step_label, 24, 0) + par_grid.addWidget(self.jog_step_entry, 24, 1) # JOG Feedrate self.jog_fr_label = FCLabel('%s:' % _("Feedrate")) @@ -156,8 +161,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): self.jog_fr_entry.set_precision(self.decimals) self.jog_fr_entry.set_range(0, 910000.0000) - grid0.addWidget(self.jog_fr_label, 26, 0) - grid0.addWidget(self.jog_fr_entry, 26, 1) + par_grid.addWidget(self.jog_fr_label, 26, 0) + par_grid.addWidget(self.jog_fr_entry, 26, 1) # JOG Travel Z self.jog_travelz_label = FCLabel('%s:' % _("Travel Z")) @@ -169,7 +174,7 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI): self.jog_travelz_entry.set_precision(self.decimals) self.jog_travelz_entry.set_range(0, 910000.0000) - grid0.addWidget(self.jog_travelz_label, 28, 0) - grid0.addWidget(self.jog_travelz_entry, 28, 1) + par_grid.addWidget(self.jog_travelz_label, 28, 0) + par_grid.addWidget(self.jog_travelz_entry, 28, 1) self.layout.addStretch(1) diff --git a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py index 51fed78b..462e62c2 100644 --- a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py @@ -141,7 +141,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): ) self.milling_type_radio = RadioSet([{'label': _('Climb'), 'value': 'cl'}, - {'label': _('Conventional'), 'value': 'cv'}]) + {'label': _('Conventional'), 'value': 'cv'}], compact=True) self.milling_type_radio.setToolTip( _("Milling type:\n" "- climb / best for precision milling and to reduce tool usage\n" @@ -210,7 +210,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): # {"label": _("Standard"), "value": "standard"}, # {"label": _("Seed-based"), "value": "seed"}, # {"label": _("Straight lines"), "value": "lines"} - # ], orientation='vertical', stretch=False) + # ], orientation='vertical', compact=True) self.ncc_method_combo = FCComboBox2() self.ncc_method_combo.addItems( [_("Standard"), _("Seed"), _("Lines"), _("Combo")] @@ -302,7 +302,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): # {"label": _("Area Selection"), "value": "area"}, # {'label': _('Reference Object'), 'value': 'box'}], # orientation='vertical', - # stretch=None) + # compact=None) self.select_combo = FCComboBox2() self.select_combo.addItems( [_("Itself"), _("Area Selection"), _("Reference Object")] @@ -324,7 +324,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): ) self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'}, - {'label': _("Polygon"), 'value': 'polygon'}]) + {'label': _("Polygon"), 'value': 'polygon'}], compact=True) gen_grid.addWidget(self.area_shape_label, 4, 0) gen_grid.addWidget(self.area_shape_radio, 4, 1) @@ -336,7 +336,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): # ## Plotting type self.plotting_radio = RadioSet([{'label': _('Normal'), 'value': 'normal'}, - {"label": _("Progressive"), "value": "progressive"}]) + {"label": _("Progressive"), "value": "progressive"}], compact=True) plotting_label = FCLabel('%s:' % _("Plotting")) plotting_label.setToolTip( _("- 'Normal' - normal plotting, done at the end of the job\n" diff --git a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py index 18747147..d0100479 100644 --- a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt6 import QtWidgets from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox2, FCCheckBox, NumericalEvalTupleEntry, FCLabel, \ - FCGridLayout + FCGridLayout, FCFrame from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -25,15 +25,21 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): # ------------------------------ # ## Paint area # ------------------------------ - self.paint_label = FCLabel('%s:' % _('Parameters')) + self.paint_label = FCLabel('%s' % _('Parameters')) self.paint_label.setToolTip( _("Creates tool paths to cover the\n" "whole area of a polygon.") ) self.layout.addWidget(self.paint_label) - grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - self.layout.addLayout(grid0) + # ############################################################################################################# + # Parameters Frame + # ############################################################################################################# + par_frame = FCFrame() + self.layout.addWidget(par_frame) + + param_grid = FCGridLayout(v_spacing=5, h_spacing=3) + par_frame.setLayout(param_grid) # Tool dia ptdlabel = FCLabel('%s:' % _('Tools Dia')) @@ -42,20 +48,26 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): "The value of the diameter has to use the dot decimals separator.\n" "Valid values: 0.3, 1.0") ) - grid0.addWidget(ptdlabel, 0, 0) + param_grid.addWidget(ptdlabel, 0, 0) self.painttooldia_entry = NumericalEvalTupleEntry(border_color='#0069A9') self.painttooldia_entry.setPlaceholderText(_("Comma separated values")) - grid0.addWidget(self.painttooldia_entry, 0, 1) + param_grid.addWidget(self.painttooldia_entry, 0, 1) - # Tool Type Radio Button - self.tool_type_label = FCLabel('%s:' % _('Tool Type')) - self.tool_type_label.setToolTip( - _("Default tool type:\n" - "- 'V-shape'\n" - "- Circular") - ) + self.paint_order_label = FCLabel('%s:' % _('Tool order')) + self.paint_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n" + "'No' --> means that the used order is the one in the tool table\n" + "'Forward' --> means that the tools will be ordered from small to big\n" + "'Reverse' --> means that the tools will ordered from big to small\n\n" + "WARNING: using rest machining will automatically set the order\n" + "in reverse and disable this control.")) + + self.paint_order_combo = FCComboBox2() + self.paint_order_combo.addItems([_('Default'), _('Forward'), _('Reverse')]) + + param_grid.addWidget(self.paint_order_label, 2, 0) + param_grid.addWidget(self.paint_order_combo, 2, 1) # Tip Dia self.tipdialabel = FCLabel('%s:' % _('V-Tip Dia')) @@ -67,8 +79,8 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): self.tipdia_entry.setSingleStep(0.1) self.tipdia_entry.setObjectName(_("V-Tip Dia")) - grid0.addWidget(self.tipdialabel, 2, 0) - grid0.addWidget(self.tipdia_entry, 2, 1) + param_grid.addWidget(self.tipdialabel, 4, 0) + param_grid.addWidget(self.tipdia_entry, 4, 1) # Tip Angle self.tipanglelabel = FCLabel('%s:' % _('V-Tip Angle')) @@ -81,8 +93,8 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): self.tipangle_entry.setSingleStep(5) self.tipangle_entry.setObjectName(_("V-Tip Angle")) - grid0.addWidget(self.tipanglelabel, 3, 0) - grid0.addWidget(self.tipangle_entry, 3, 1) + param_grid.addWidget(self.tipanglelabel, 6, 0) + param_grid.addWidget(self.tipangle_entry, 6, 1) # Cut Z entry cutzlabel = FCLabel('%s:' % _('Cut Z')) @@ -99,8 +111,8 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): _("Depth of cut into material. Negative value.\n" "In application units.") ) - grid0.addWidget(cutzlabel, 4, 0) - grid0.addWidget(self.cutz_entry, 4, 1) + param_grid.addWidget(cutzlabel, 8, 0) + param_grid.addWidget(self.cutz_entry, 8, 1) # ### Tool Diameter #### self.newdialabel = FCLabel('%s:' % _('New Dia')) @@ -114,33 +126,26 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): self.newdia_entry.set_range(-10000.000, 10000.0000) self.newdia_entry.setObjectName(_("Tool Dia")) - grid0.addWidget(self.newdialabel, 5, 0) - grid0.addWidget(self.newdia_entry, 5, 1) + param_grid.addWidget(self.newdialabel, 10, 0) + param_grid.addWidget(self.newdia_entry, 10, 1) - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 6, 0, 1, 2) + # separator_line = QtWidgets.QFrame() + # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) + # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) + # param_grid.addWidget(separator_line, 6, 0, 1, 2) - self.paint_order_label = FCLabel('%s:' % _('Tool order')) - self.paint_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n" - "'No' --> means that the used order is the one in the tool table\n" - "'Forward' --> means that the tools will be ordered from small to big\n" - "'Reverse' --> means that the tools will ordered from big to small\n\n" - "WARNING: using rest machining will automatically set the order\n" - "in reverse and disable this control.")) + # ############################################################################################################# + # Tool Frame + # ############################################################################################################# + # ### Tools ## ## + self.tools_table_label = FCLabel('%s' % _("Tool Parameters")) + self.layout.addWidget(self.tools_table_label) - self.paint_order_radio = RadioSet([{'label': _('No'), 'value': 'no'}, - {'label': _('Forward'), 'value': 'fwd'}, - {'label': _('Reverse'), 'value': 'rev'}]) + tt_frame = FCFrame() + self.layout.addWidget(tt_frame) - grid0.addWidget(self.paint_order_label, 7, 0) - grid0.addWidget(self.paint_order_radio, 7, 1) - - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 8, 0, 1, 2) + tool_grid = FCGridLayout(v_spacing=5, h_spacing=3) + tt_frame.setLayout(tool_grid) # Overlap ovlabel = FCLabel('%s:' % _('Overlap')) @@ -159,8 +164,8 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): self.paintoverlap_entry.setRange(0.0000, 99.9999) self.paintoverlap_entry.setSingleStep(0.1) - grid0.addWidget(ovlabel, 9, 0) - grid0.addWidget(self.paintoverlap_entry, 9, 1) + tool_grid.addWidget(ovlabel, 0, 0) + tool_grid.addWidget(self.paintoverlap_entry, 0, 1) # Margin marginlabel = FCLabel('%s:' % _('Margin')) @@ -174,8 +179,8 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): self.paintmargin_entry.set_precision(self.decimals) self.paintmargin_entry.setSingleStep(0.1) - grid0.addWidget(marginlabel, 10, 0) - grid0.addWidget(self.paintmargin_entry, 10, 1) + tool_grid.addWidget(marginlabel, 2, 0) + tool_grid.addWidget(self.paintmargin_entry, 2, 1) # Method methodlabel = FCLabel('%s:' % _('Method')) @@ -194,14 +199,14 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): # {"label": _("Standard"), "value": "standard"}, # {"label": _("Seed-based"), "value": "seed"}, # {"label": _("Straight lines"), "value": "lines"} - # ], orientation='vertical', stretch=False) + # ], orientation='vertical', compact=True) self.paintmethod_combo = FCComboBox2() self.paintmethod_combo.addItems( [_("Standard"), _("Seed"), _("Lines"), _("Laser_lines"), _("Combo")] ) - grid0.addWidget(methodlabel, 11, 0) - grid0.addWidget(self.paintmethod_combo, 11, 1) + tool_grid.addWidget(methodlabel, 4, 0) + tool_grid.addWidget(self.paintmethod_combo, 4, 1) # Connect lines self.pathconnect_cb = FCCheckBox('%s' % _("Connect")) @@ -209,7 +214,6 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): _("Draw lines between resulting\n" "segments to minimize tool lifts.") ) - grid0.addWidget(self.pathconnect_cb, 12, 0) # Paint contour self.contour_cb = FCCheckBox('%s' % _("Contour")) @@ -217,12 +221,24 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): _("Cut around the perimeter of the polygon\n" "to trim rough edges.") ) - grid0.addWidget(self.contour_cb, 12, 1) - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 13, 0, 1, 2) + tool_grid.addWidget(self.pathconnect_cb, 6, 0) + tool_grid.addWidget(self.contour_cb, 6, 1) + + # ############################################################################################################# + # General Parameters Frame + # ############################################################################################################# + self.gen_param_label = FCLabel('%s' % _("Common Parameters")) + self.gen_param_label.setToolTip( + _("Parameters that are common for all tools.") + ) + self.layout.addWidget(self.gen_param_label) + + gp_frame = FCFrame() + self.layout.addWidget(gp_frame) + + gen_grid = FCGridLayout(v_spacing=5, h_spacing=3) + gp_frame.setLayout(gen_grid) self.rest_cb = FCCheckBox('%s' % _("Rest")) self.rest_cb.setObjectName(_("Rest")) @@ -235,7 +251,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): "nothing left to process or there are no more tools.\n\n" "If not checked, use the standard algorithm.") ) - grid0.addWidget(self.rest_cb, 14, 0, 1, 2) + gen_grid.addWidget(self.rest_cb, 0, 0, 1, 2) # Polygon selection selectlabel = FCLabel('%s:' % _('Selection')) @@ -256,15 +272,15 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): # {"label": _("Reference Object"), "value": "ref"} # ], # orientation='vertical', - # stretch=None + # compact=None # ) self.selectmethod_combo = FCComboBox2() self.selectmethod_combo.addItems( [_("All"), _("Polygon Selection"), _("Area Selection"), _("Reference Object")] ) - grid0.addWidget(selectlabel, 15, 0) - grid0.addWidget(self.selectmethod_combo, 15, 1) + gen_grid.addWidget(selectlabel, 2, 0) + gen_grid.addWidget(self.selectmethod_combo, 2, 1) self.area_shape_label = FCLabel('%s:' % _("Shape")) self.area_shape_label.setToolTip( @@ -272,25 +288,28 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): ) self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'}, - {'label': _("Polygon"), 'value': 'polygon'}]) + {'label': _("Polygon"), 'value': 'polygon'}], compact=True) - grid0.addWidget(self.area_shape_label, 18, 0) - grid0.addWidget(self.area_shape_radio, 18, 1) + gen_grid.addWidget(self.area_shape_label, 4, 0) + gen_grid.addWidget(self.area_shape_radio, 4, 1) separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 19, 0, 1, 2) + gen_grid.addWidget(separator_line, 6, 0, 1, 2) # ## Plotting type self.paint_plotting_radio = RadioSet([{'label': _('Normal'), 'value': 'normal'}, - {"label": _("Progressive"), "value": "progressive"}]) + {"label": _("Progressive"), "value": "progressive"}], + compact=True) plotting_label = FCLabel('%s:' % _("Plotting")) plotting_label.setToolTip( _("- 'Normal' - normal plotting, done at the end of the job\n" "- 'Progressive' - each shape is plotted after it is generated") ) - grid0.addWidget(plotting_label, 20, 0) - grid0.addWidget(self.paint_plotting_radio, 20, 1) + gen_grid.addWidget(plotting_label, 8, 0) + gen_grid.addWidget(self.paint_plotting_radio, 8, 1) - self.layout.addStretch() + FCGridLayout.set_common_column_size([tool_grid, param_grid, gen_grid], 0) + + self.layout.addStretch(1) diff --git a/appPlugins/ToolCalculators.py b/appPlugins/ToolCalculators.py index 4d572955..53bd3f5f 100644 --- a/appPlugins/ToolCalculators.py +++ b/appPlugins/ToolCalculators.py @@ -690,7 +690,7 @@ class CalcUI: self.area_sel_radio = RadioSet([ {'label': _('Dimensions'), 'value': 'd'}, {"label": _("Area"), "value": "a"} - ], stretch=False) + ], compact=True) grid_electro.addWidget(self.area_sel_label, 4, 0) grid_electro.addWidget(self.area_sel_radio, 6, 0, 1, 2) @@ -874,7 +874,7 @@ class CalcUI: self.sol_radio = RadioSet([ {'label': '1', 'value': 'sol1'}, {"label": '2', "value": "sol2"} - ], stretch=False) + ], compact=True) grid_tin.addWidget(self.solution_lbl, 4, 0) grid_tin.addWidget(self.sol_radio, 4, 1) diff --git a/appPlugins/ToolCalibration.py b/appPlugins/ToolCalibration.py index baef3d1c..b6591774 100644 --- a/appPlugins/ToolCalibration.py +++ b/appPlugins/ToolCalibration.py @@ -905,7 +905,7 @@ class CalibrationUI: "- Free -> click freely on canvas to acquire the calibration points")) self.cal_source_radio = RadioSet([{'label': _('Object'), 'value': 'object'}, {'label': _('Free'), 'value': 'free'}], - stretch=False) + compact=True) grid_lay.addWidget(self.cal_source_lbl, 11, 0) grid_lay.addWidget(self.cal_source_radio, 11, 1, 1, 2) diff --git a/appPlugins/ToolCopperThieving.py b/appPlugins/ToolCopperThieving.py index 681eb546..495b231d 100644 --- a/appPlugins/ToolCopperThieving.py +++ b/appPlugins/ToolCopperThieving.py @@ -1422,7 +1422,7 @@ class ThievingUI: self.bbox_type_radio = RadioSet([ {'label': _('Rectangular'), 'value': 'rect'}, {"label": _("Minimal"), "value": "min"} - ], stretch=False) + ], compact=True) grid_lay.addWidget(self.bbox_type_label, 14, 0) grid_lay.addWidget(self.bbox_type_radio, 14, 1) @@ -1757,7 +1757,7 @@ class ThievingUI: # {'label': _('Thieving'), 'value': 't'}, # {"label": _("Robber bar"), "value": "r"}, # {"label": _("None"), "value": "n"} - # ], orientation='vertical', stretch=False) + # ], orientation='vertical', compact=True) self.ppm_choice_combo = FCComboBox2() self.ppm_choice_combo.addItems([_("Both"), _('Thieving'), _("Robber bar"), _("None")]) grid_lay_2.addWidget(self.ppm_choice_label, 6, 0) diff --git a/appPlugins/ToolCutOut.py b/appPlugins/ToolCutOut.py index 55e9bb28..b0fbce2c 100644 --- a/appPlugins/ToolCutOut.py +++ b/appPlugins/ToolCutOut.py @@ -2437,7 +2437,7 @@ class CutoutUI: # {'label': _('Thin'), 'value': 'bt'}, # {'label': "M-Bites", 'value': 'mb'} # ], - # stretch=True + # compact=True # ) self.gaptype_combo = FCComboBox2() self.gaptype_combo.addItems([_('Bridge'), _('Thin'), _("Mouse Bytes")]) diff --git a/appPlugins/ToolDblSided.py b/appPlugins/ToolDblSided.py index 8678b6fb..83d6ca19 100644 --- a/appPlugins/ToolDblSided.py +++ b/appPlugins/ToolDblSided.py @@ -849,7 +849,7 @@ class DsidedUI: {'label': 'X', 'value': 'X'}, {'label': 'Y', 'value': 'Y'} ], - stretch=True + compact=True ) grid_mirror.addWidget(self.mirax_label, 2, 0) @@ -876,7 +876,7 @@ class DsidedUI: {'label': _('Box'), 'value': 'box'}, {'label': _('Snap'), 'value': 'hole'}, ], - stretch=True + compact=True ) grid_mirror.addWidget(self.axloc_label, 4, 0) @@ -1048,7 +1048,7 @@ class DsidedUI: {'label': 'X', 'value': 'X'}, {'label': 'Y', 'value': 'Y'} ], - stretch=True + compact=True ) grid4.addWidget(self.align_ax_label, 4, 0) diff --git a/appPlugins/ToolEtchCompensation.py b/appPlugins/ToolEtchCompensation.py index fdae675b..83138283 100644 --- a/appPlugins/ToolEtchCompensation.py +++ b/appPlugins/ToolEtchCompensation.py @@ -437,7 +437,7 @@ class EtchUI: {'label': _('Etch Factor'), 'value': 'factor'}, {'label': _('Etchants list'), 'value': 'etch_list'}, {'label': _('Manual offset'), 'value': 'manual'} - ], orientation='vertical', stretch=False) + ], orientation='vertical', compact=True) grid1.addWidget(self.ratio_label, 2, 0, 1, 2) grid1.addWidget(self.ratio_radio, 4, 0, 1, 2) diff --git a/appPlugins/ToolExtract.py b/appPlugins/ToolExtract.py index 8145b8cd..4423dff3 100644 --- a/appPlugins/ToolExtract.py +++ b/appPlugins/ToolExtract.py @@ -1114,7 +1114,7 @@ class ExtractUI: {'label': _("Fixed Annular Ring"), 'value': 'ring'} ], orientation='vertical', - stretch=False) + compact=True) grid1.addWidget(self.method_radio, 4, 0, 1, 2) diff --git a/appPlugins/ToolFiducials.py b/appPlugins/ToolFiducials.py index af7b40b2..0ff959c6 100644 --- a/appPlugins/ToolFiducials.py +++ b/appPlugins/ToolFiducials.py @@ -999,7 +999,7 @@ class FidoUI: {'label': _('Up'), 'value': 'up'}, {"label": _("Down"), "value": "down"}, {"label": _("None"), "value": "no"} - ], stretch=False) + ], compact=True) self.pos_label = FCLabel('%s:' % _("Second fiducial")) self.pos_label.setToolTip( _("The position for the second fiducial.\n" @@ -1065,7 +1065,7 @@ class FidoUI: self.mode_radio = RadioSet([ {'label': _('Auto'), 'value': 'auto'}, {"label": _("Manual"), "value": "manual"} - ], stretch=False) + ], compact=True) self.mode_label = FCLabel(_("Mode:")) self.mode_label.setToolTip( _("- 'Auto' - automatic placement of fiducials in the corners of the bounding box.\n" diff --git a/appPlugins/ToolFilm.py b/appPlugins/ToolFilm.py index 5e233e27..eb2e2140 100644 --- a/appPlugins/ToolFilm.py +++ b/appPlugins/ToolFilm.py @@ -1322,7 +1322,7 @@ class FilmUI: # Scale Geometry self.film_scale_cb = FCCheckBox('%s' % _("Scale")) self.film_scale_cb.setToolTip( - _("A value greater than 1 will stretch the film\n" + _("A value greater than 1 will compact the film\n" "while a value less than 1 will jolt it.") ) self.film_scale_cb.setStyleSheet( @@ -1456,7 +1456,7 @@ class FilmUI: self.film_mirror_axis = RadioSet([{'label': _('X'), 'value': 'x'}, {'label': _('Y'), 'value': 'y'}, {'label': _('Both'), 'value': 'both'}], - stretch=False) + compact=True) self.film_mirror_axis_label = FCLabel('%s:' % _("Axis")) self.film_mirror_axis_label.setToolTip( _("Mirror the film geometry on the selected axis or on both.") @@ -1525,7 +1525,7 @@ class FilmUI: # Polarity self.film_type = RadioSet([{'label': _('Positive'), 'value': 'pos'}, {'label': _('Negative'), 'value': 'neg'}], - stretch=False) + compact=True) self.film_type_label = FCLabel('%s:' % _("Polarity")) self.film_type_label.setToolTip( _("Generate a Positive black film or a Negative film.") @@ -1582,7 +1582,7 @@ class FilmUI: ) self.source_punch = RadioSet([{'label': _('Excellon'), 'value': 'exc'}, {'label': _('Pad center'), 'value': 'pad'}], - stretch=False) + compact=True) punch_grid.addWidget(self.source_label, 0, 0) punch_grid.addWidget(self.source_punch, 0, 1) @@ -1637,7 +1637,7 @@ class FilmUI: self.file_type_radio = RadioSet([{'label': _('SVG'), 'value': 'svg'}, {'label': _('PNG'), 'value': 'png'}, {'label': _('PDF'), 'value': 'pdf'} - ], stretch=False) + ], compact=True) grid3.addWidget(self.file_type_label, 0, 0) grid3.addWidget(self.file_type_radio, 0, 1) @@ -1650,7 +1650,7 @@ class FilmUI: self.orientation_radio = RadioSet([{'label': _('Portrait'), 'value': 'p'}, {'label': _('Landscape'), 'value': 'l'}, - ], stretch=False) + ], compact=True) # ############################################################################################################# # ################################ New Grid ################################################################## diff --git a/appPlugins/ToolInvertGerber.py b/appPlugins/ToolInvertGerber.py index c6f4db2b..aaaff114 100644 --- a/appPlugins/ToolInvertGerber.py +++ b/appPlugins/ToolInvertGerber.py @@ -291,7 +291,7 @@ class InvertUI: {'label': _('Rounded'), 'value': 'r'}, {'label': _('Square'), 'value': 's'}, {'label': _('Bevel'), 'value': 'b'} - ], orientation='vertical', stretch=False) + ], orientation='vertical', compact=True) grid0.addWidget(self.join_label, 2, 0) grid0.addWidget(self.join_radio, 2, 1) diff --git a/appPlugins/ToolMilling.py b/appPlugins/ToolMilling.py index 54d7ffbb..663c3c57 100644 --- a/appPlugins/ToolMilling.py +++ b/appPlugins/ToolMilling.py @@ -3581,8 +3581,8 @@ class MillingUI: self.tools_box.addWidget(obj_frame) # Grid Layout - grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - obj_frame.setLayout(grid0) + obj_grid = FCGridLayout(v_spacing=5, h_spacing=3) + obj_frame.setLayout(obj_grid) self.target_label = FCLabel('%s:' % _("Type")) self.target_label.setToolTip( @@ -3593,10 +3593,11 @@ class MillingUI: [ {'label': _('Geometry'), 'value': 'geo'}, {'label': _('Excellon'), 'value': 'exc'} - ]) + ], + compact=True) - grid0.addWidget(self.target_label, 0, 0) - grid0.addWidget(self.target_radio, 0, 1) + obj_grid.addWidget(self.target_label, 0, 0) + obj_grid.addWidget(self.target_radio, 0, 1) # ################################################ # ##### The object to be milled ################# @@ -3607,46 +3608,46 @@ class MillingUI: # self.object_combo.setCurrentIndex(1) self.object_combo.is_last = True - grid0.addWidget(self.object_combo, 2, 0, 1, 2) + obj_grid.addWidget(self.object_combo, 2, 0, 1, 2) # separator_line = QtWidgets.QFrame() # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - # grid0.addWidget(separator_line, 4, 0, 1, 2) + # obj_grid.addWidget(separator_line, 4, 0, 1, 2) # ############################################################################################################# # Tool Table Frame # ############################################################################################################# # Grid Layout - grid_title_tool_table = FCGridLayout(v_spacing=5, h_spacing=3) - self.tools_box.addLayout(grid_title_tool_table) + tool_title_grid = FCGridLayout(v_spacing=5, h_spacing=3) + self.tools_box.addLayout(tool_title_grid) self.tools_table_label = FCLabel('%s' % _('Tools Table')) self.tools_table_label.setToolTip( _("Tools in the object used for milling.") ) - grid_title_tool_table.addWidget(self.tools_table_label, 0, 0) + tool_title_grid.addWidget(self.tools_table_label, 0, 0) # Plot CB self.plot_cb = FCCheckBox(_('Plot Object')) self.plot_cb.setToolTip(_("Plot (show) this object.")) self.plot_cb.setLayoutDirection(QtCore.Qt.LayoutDirection.RightToLeft) - grid_title_tool_table.addWidget(self.plot_cb, 0, 1) + tool_title_grid.addWidget(self.plot_cb, 0, 1) tt_frame = FCFrame() self.tools_box.addWidget(tt_frame) # Grid Layout - grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - tt_frame.setLayout(grid1) + tool_grid = FCGridLayout(v_spacing=5, h_spacing=3) + tt_frame.setLayout(tool_grid) # ################################################ # ########## Excellon Tool Table ################# # ################################################ self.tools_table = FCTable(drag_drop=True) self.tools_table.setRowCount(2) - grid1.addWidget(self.tools_table, 0, 0, 1, 2) + tool_grid.addWidget(self.tools_table, 0, 0, 1, 2) self.tools_table.setColumnCount(5) self.tools_table.setColumnHidden(3, True) @@ -3751,8 +3752,8 @@ class MillingUI: self.order_combo = FCComboBox2() self.order_combo.addItems([_('Default'), _('Forward'), _('Reverse')]) - grid1.addWidget(self.order_label, 2, 0) - grid1.addWidget(self.order_combo, 2, 1) + tool_grid.addWidget(self.order_label, 2, 0) + tool_grid.addWidget(self.order_combo, 2, 1) # ************************************************************************ # ************** Geometry Tool Table ************************************* @@ -3764,7 +3765,7 @@ class MillingUI: self.geo_tools_table.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) self.geo_tools_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) - grid1.addWidget(self.geo_tools_table, 4, 0, 1, 2) + tool_grid.addWidget(self.geo_tools_table, 4, 0, 1, 2) self.geo_tools_table.setColumnCount(5) self.geo_tools_table.setColumnWidth(0, 20) @@ -3801,19 +3802,19 @@ class MillingUI: # ############################################################################################################# self.add_tool_frame = QtWidgets.QFrame() self.add_tool_frame.setContentsMargins(0, 0, 0, 0) - grid1.addWidget(self.add_tool_frame, 6, 0, 1, 2) + tool_grid.addWidget(self.add_tool_frame, 6, 0, 1, 2) - grid_add_tool = FCGridLayout(v_spacing=5, h_spacing=3) - grid_add_tool.setContentsMargins(0, 0, 0, 0) - self.add_tool_frame.setLayout(grid_add_tool) + new_tool_grid = FCGridLayout(v_spacing=5, h_spacing=3) + new_tool_grid.setContentsMargins(0, 0, 0, 0) + self.add_tool_frame.setLayout(new_tool_grid) separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid_add_tool.addWidget(separator_line, 0, 0, 1, 2) + new_tool_grid.addWidget(separator_line, 0, 0, 1, 2) self.tool_sel_label = FCLabel('%s' % _("Add from DB")) - grid_add_tool.addWidget(self.tool_sel_label, 2, 0, 1, 2) + new_tool_grid.addWidget(self.tool_sel_label, 2, 0, 1, 2) self.addtool_entry_lbl = FCLabel('%s:' % _('Tool Dia')) self.addtool_entry_lbl.setToolTip( @@ -3825,8 +3826,8 @@ class MillingUI: self.addtool_entry.setSingleStep(0.1) self.addtool_entry.setObjectName("mill_cnctooldia") - grid_add_tool.addWidget(self.addtool_entry_lbl, 3, 0) - grid_add_tool.addWidget(self.addtool_entry, 3, 1) + new_tool_grid.addWidget(self.addtool_entry_lbl, 3, 0) + new_tool_grid.addWidget(self.addtool_entry, 3, 1) # ############################################################################################################# # ################################ Button Grid ########################################################### @@ -3834,7 +3835,7 @@ class MillingUI: button_grid = FCGridLayout(v_spacing=5, h_spacing=3) button_grid.setColumnStretch(0, 1) button_grid.setColumnStretch(1, 0) - grid_add_tool.addLayout(button_grid, 5, 0, 1, 2) + new_tool_grid.addLayout(button_grid, 5, 0, 1, 2) self.search_and_add_btn = FCButton(_('Search and Add')) self.search_and_add_btn.setIcon(QtGui.QIcon(self.app.resource_location + '/plus16.png')) @@ -3901,8 +3902,8 @@ class MillingUI: self.tool_params_box.addWidget(tp_frame) # Grid Layout - grid2 = FCGridLayout(v_spacing=5, h_spacing=3) - tp_frame.setLayout(grid2) + param_grid = FCGridLayout(v_spacing=5, h_spacing=3) + tp_frame.setLayout(param_grid) # Milling Type self.mill_type_label = FCLabel('%s:' % _('Milling Type')) @@ -3921,8 +3922,8 @@ class MillingUI: ) self.milling_type_radio.setObjectName("milling_type") - grid2.addWidget(self.mill_type_label, 0, 0) - grid2.addWidget(self.milling_type_radio, 1, 0, 1, 2) + param_grid.addWidget(self.mill_type_label, 0, 0) + param_grid.addWidget(self.milling_type_radio, 1, 0, 1, 2) # Milling Diameter self.mill_dia_label = FCLabel('%s:' % _('Milling Diameter')) @@ -3935,8 +3936,8 @@ class MillingUI: self.mill_dia_entry.set_range(0.0000, 10000.0000) self.mill_dia_entry.setObjectName("milling_dia") - grid2.addWidget(self.mill_dia_label, 2, 0) - grid2.addWidget(self.mill_dia_entry, 2, 1) + param_grid.addWidget(self.mill_dia_label, 2, 0) + param_grid.addWidget(self.mill_dia_entry, 2, 1) self.mill_type_label.hide() self.milling_type_radio.hide() @@ -3960,8 +3961,8 @@ class MillingUI: ) self.offset_type_combo.setObjectName('mill_offset_type') - grid2.addWidget(self.offset_type_lbl, 4, 0) - grid2.addWidget(self.offset_type_combo, 4, 1) + param_grid.addWidget(self.offset_type_lbl, 4, 0) + param_grid.addWidget(self.offset_type_combo, 4, 1) # Tool Offset self.offset_label = FCLabel('%s:' % _('Custom')) @@ -3982,13 +3983,13 @@ class MillingUI: self.offset_label.hide() self.offset_entry.hide() - grid2.addWidget(self.offset_label, 6, 0) - grid2.addWidget(self.offset_entry, 6, 1) + param_grid.addWidget(self.offset_label, 6, 0) + param_grid.addWidget(self.offset_entry, 6, 1) self.offset_separator_line = QtWidgets.QFrame() self.offset_separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) self.offset_separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid2.addWidget(self.offset_separator_line, 7, 0, 1, 2) + param_grid.addWidget(self.offset_separator_line, 7, 0, 1, 2) # Tool Type self.tool_shape_label = FCLabel('%s:' % _('Shape')) @@ -4011,8 +4012,8 @@ class MillingUI: else: self.tool_shape_combo.setCurrentIndex(idx) - grid2.addWidget(self.tool_shape_label, 8, 0) - grid2.addWidget(self.tool_shape_combo, 8, 1) + param_grid.addWidget(self.tool_shape_label, 8, 0) + param_grid.addWidget(self.tool_shape_combo, 8, 1) # Job Type self.job_type_lbl = FCLabel('%s:' % _('Job')) @@ -4031,8 +4032,8 @@ class MillingUI: ) self.job_type_combo.setObjectName('mill_job_type') - grid2.addWidget(self.job_type_lbl, 10, 0) - grid2.addWidget(self.job_type_combo, 10, 1) + param_grid.addWidget(self.job_type_lbl, 10, 0) + param_grid.addWidget(self.job_type_combo, 10, 1) # Polish Margin self.polish_margin_lbl = FCLabel('%s:' % _('Margin')) @@ -4044,8 +4045,8 @@ class MillingUI: self.polish_margin_entry.set_range(-10000.0000, 10000.0000) self.polish_margin_entry.setObjectName("mill_polish_margin") - grid2.addWidget(self.polish_margin_lbl, 12, 0) - grid2.addWidget(self.polish_margin_entry, 12, 1) + param_grid.addWidget(self.polish_margin_lbl, 12, 0) + param_grid.addWidget(self.polish_margin_entry, 12, 1) # Polish Overlap self.polish_over_lbl = FCLabel('%s:' % _('Overlap')) @@ -4059,8 +4060,8 @@ class MillingUI: self.polish_over_entry.setSingleStep(0.1) self.polish_over_entry.setObjectName("mill_polish_overlap") - grid2.addWidget(self.polish_over_lbl, 14, 0) - grid2.addWidget(self.polish_over_entry, 14, 1) + param_grid.addWidget(self.polish_over_lbl, 14, 0) + param_grid.addWidget(self.polish_over_entry, 14, 1) # Polish Method self.polish_method_lbl = FCLabel('%s:' % _('Method')) @@ -4077,8 +4078,8 @@ class MillingUI: ) self.polish_method_combo.setObjectName('mill_polish_method') - grid2.addWidget(self.polish_method_lbl, 16, 0) - grid2.addWidget(self.polish_method_combo, 16, 1) + param_grid.addWidget(self.polish_method_lbl, 16, 0) + param_grid.addWidget(self.polish_method_combo, 16, 1) self.polish_margin_lbl.hide() self.polish_margin_entry.hide() @@ -4090,7 +4091,7 @@ class MillingUI: self.job_separator_line = QtWidgets.QFrame() self.job_separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) self.job_separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid2.addWidget(self.job_separator_line, 18, 0, 1, 2) + param_grid.addWidget(self.job_separator_line, 18, 0, 1, 2) # Tip Dia self.tipdialabel = FCLabel('%s:' % _('V-Tip Dia')) @@ -4105,8 +4106,8 @@ class MillingUI: self.tipdia_entry.setSingleStep(0.1) self.tipdia_entry.setObjectName("mill_tipdia") - grid2.addWidget(self.tipdialabel, 20, 0) - grid2.addWidget(self.tipdia_entry, 20, 1) + param_grid.addWidget(self.tipdialabel, 20, 0) + param_grid.addWidget(self.tipdia_entry, 20, 1) # Tip Angle self.tipanglelabel = FCLabel('%s:' % _('V-Tip Angle')) @@ -4122,8 +4123,8 @@ class MillingUI: self.tipangle_entry.setSingleStep(1) self.tipangle_entry.setObjectName("mill_tipangle") - grid2.addWidget(self.tipanglelabel, 22, 0) - grid2.addWidget(self.tipangle_entry, 22, 1) + param_grid.addWidget(self.tipanglelabel, 22, 0) + param_grid.addWidget(self.tipangle_entry, 22, 1) self.tipdialabel.hide() self.tipdia_entry.hide() @@ -4145,8 +4146,8 @@ class MillingUI: self.cutz_entry.setSingleStep(0.1) self.cutz_entry.setObjectName("mill_cutz") - grid2.addWidget(self.cutzlabel, 24, 0) - grid2.addWidget(self.cutz_entry, 24, 1) + param_grid.addWidget(self.cutzlabel, 24, 0) + param_grid.addWidget(self.cutz_entry, 24, 1) # Multi-Depth self.mpass_cb = FCCheckBox('%s:' % _("Multi-Depth")) @@ -4170,8 +4171,8 @@ class MillingUI: self.mis_mpass_geo = OptionalInputSection(self.mpass_cb, [self.maxdepth_entry]) - grid2.addWidget(self.mpass_cb, 26, 0) - grid2.addWidget(self.maxdepth_entry, 26, 1) + param_grid.addWidget(self.mpass_cb, 26, 0) + param_grid.addWidget(self.maxdepth_entry, 26, 1) # Travel Z (z_move) self.travelzlabel = FCLabel('%s:' % _('Travel Z')) @@ -4188,8 +4189,8 @@ class MillingUI: self.travelz_entry.setSingleStep(0.1) self.travelz_entry.setObjectName("mill_travelz") - grid2.addWidget(self.travelzlabel, 28, 0) - grid2.addWidget(self.travelz_entry, 28, 1) + param_grid.addWidget(self.travelzlabel, 28, 0) + param_grid.addWidget(self.travelz_entry, 28, 1) # Feedrate X-Y self.frxylabel = FCLabel('%s:' % _('Feedrate X-Y')) @@ -4203,8 +4204,8 @@ class MillingUI: self.xyfeedrate_entry.setSingleStep(0.1) self.xyfeedrate_entry.setObjectName("mill_feedratexy") - grid2.addWidget(self.frxylabel, 30, 0) - grid2.addWidget(self.xyfeedrate_entry, 30, 1) + param_grid.addWidget(self.frxylabel, 30, 0) + param_grid.addWidget(self.xyfeedrate_entry, 30, 1) self.frxylabel.hide() self.xyfeedrate_entry.hide() @@ -4223,8 +4224,8 @@ class MillingUI: self.feedrate_z_entry.setSingleStep(0.1) self.feedrate_z_entry.setObjectName("mill_feedratez") - grid2.addWidget(self.frzlabel, 32, 0) - grid2.addWidget(self.feedrate_z_entry, 32, 1) + param_grid.addWidget(self.frzlabel, 32, 0) + param_grid.addWidget(self.feedrate_z_entry, 32, 1) # Rapid Feedrate self.feedrate_rapid_label = FCLabel('%s:' % _('Feedrate Rapids')) @@ -4241,8 +4242,8 @@ class MillingUI: self.feedrate_rapid_entry.setSingleStep(0.1) self.feedrate_rapid_entry.setObjectName("mill_fr_rapid") - grid2.addWidget(self.feedrate_rapid_label, 34, 0) - grid2.addWidget(self.feedrate_rapid_entry, 34, 1) + param_grid.addWidget(self.feedrate_rapid_label, 34, 0) + param_grid.addWidget(self.feedrate_rapid_entry, 34, 1) # default values is to hide self.feedrate_rapid_label.hide() @@ -4276,8 +4277,8 @@ class MillingUI: self.extracut_cb.hide() self.e_cut_entry.hide() - grid2.addWidget(self.extracut_cb, 36, 0) - grid2.addWidget(self.e_cut_entry, 36, 1) + param_grid.addWidget(self.extracut_cb, 36, 0) + param_grid.addWidget(self.e_cut_entry, 36, 1) # Spindlespeed self.spindle_label = FCLabel('%s:' % _('Spindle speed')) @@ -4291,8 +4292,8 @@ class MillingUI: self.spindlespeed_entry.set_step(100) self.spindlespeed_entry.setObjectName("mill_spindlespeed") - grid2.addWidget(self.spindle_label, 38, 0) - grid2.addWidget(self.spindlespeed_entry, 38, 1) + param_grid.addWidget(self.spindle_label, 38, 0) + param_grid.addWidget(self.spindlespeed_entry, 38, 1) # Dwell self.dwell_cb = FCCheckBox('%s:' % _('Dwell')) @@ -4312,8 +4313,8 @@ class MillingUI: ) self.dwelltime_entry.setObjectName("mill_dwelltime") - grid2.addWidget(self.dwell_cb, 40, 0) - grid2.addWidget(self.dwelltime_entry, 40, 1) + param_grid.addWidget(self.dwell_cb, 40, 0) + param_grid.addWidget(self.dwelltime_entry, 40, 1) self.ois_dwell = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry]) @@ -4341,8 +4342,8 @@ class MillingUI: gp_frame = FCFrame() self.tool_params_box.addWidget(gp_frame) - grid3 = FCGridLayout(v_spacing=5, h_spacing=3) - gp_frame.setLayout(grid3) + gen_grid = FCGridLayout(v_spacing=5, h_spacing=3) + gp_frame.setLayout(gen_grid) # Tool change Z: self.toolchange_cb = FCCheckBox('%s:' % _("Tool change Z")) @@ -4363,8 +4364,8 @@ class MillingUI: self.toolchangez_entry.setSingleStep(0.1) - grid3.addWidget(self.toolchange_cb, 0, 0) - grid3.addWidget(self.toolchangez_entry, 0, 1) + gen_grid.addWidget(self.toolchange_cb, 0, 0) + gen_grid.addWidget(self.toolchangez_entry, 0, 1) # Tool change X-Y self.toolchange_xy_label = FCLabel('%s:' % _('Toolchange X-Y')) @@ -4374,8 +4375,8 @@ class MillingUI: self.toolchangexy_entry = NumericalEvalTupleEntry(border_color='#0069A9') self.toolchangexy_entry.setObjectName("mill_toolchangexy") - grid3.addWidget(self.toolchange_xy_label, 2, 0) - grid3.addWidget(self.toolchangexy_entry, 2, 1) + gen_grid.addWidget(self.toolchange_xy_label, 2, 0) + gen_grid.addWidget(self.toolchangexy_entry, 2, 1) self.ois_tcz_e = OptionalInputSection(self.toolchange_cb, [ @@ -4397,8 +4398,8 @@ class MillingUI: self.endz_entry.setSingleStep(0.1) - grid3.addWidget(self.endz_label, 4, 0) - grid3.addWidget(self.endz_entry, 4, 1) + gen_grid.addWidget(self.endz_label, 4, 0) + gen_grid.addWidget(self.endz_entry, 4, 1) # End Move X,Y self.endmove_xy_label = FCLabel('%s:' % _('End move X,Y')) @@ -4411,8 +4412,8 @@ class MillingUI: self.endxy_entry.setPlaceholderText(_("X,Y coordinates")) self.endxy_entry.setObjectName("mill_endxy") - grid3.addWidget(self.endmove_xy_label, 6, 0) - grid3.addWidget(self.endxy_entry, 6, 1) + gen_grid.addWidget(self.endmove_xy_label, 6, 0) + gen_grid.addWidget(self.endxy_entry, 6, 1) # Probe depth self.pdepth_label = FCLabel('%s:' % _("Probe Z depth")) @@ -4427,8 +4428,8 @@ class MillingUI: self.pdepth_entry.setSingleStep(0.1) self.pdepth_entry.setObjectName("mill_depth_probe") - grid3.addWidget(self.pdepth_label, 8, 0) - grid3.addWidget(self.pdepth_entry, 8, 1) + gen_grid.addWidget(self.pdepth_label, 8, 0) + gen_grid.addWidget(self.pdepth_entry, 8, 1) self.pdepth_label.hide() self.pdepth_entry.setVisible(False) @@ -4445,8 +4446,8 @@ class MillingUI: self.feedrate_probe_entry.setSingleStep(0.1) self.feedrate_probe_entry.setObjectName("mill_fr_probe") - grid3.addWidget(self.feedrate_probe_label, 10, 0) - grid3.addWidget(self.feedrate_probe_entry, 10, 1) + gen_grid.addWidget(self.feedrate_probe_label, 10, 0) + gen_grid.addWidget(self.feedrate_probe_entry, 10, 1) self.feedrate_probe_label.hide() self.feedrate_probe_entry.setVisible(False) @@ -4461,8 +4462,8 @@ class MillingUI: self.pp_geo_name_cb.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) self.pp_geo_name_cb.setObjectName("mill_ppname_g") - grid3.addWidget(pp_geo_label, 12, 0) - grid3.addWidget(self.pp_geo_name_cb, 12, 1) + gen_grid.addWidget(pp_geo_label, 12, 0) + gen_grid.addWidget(self.pp_geo_name_cb, 12, 1) # Allow Levelling self.allow_level_cb = FCCheckBox('%s' % _("Allow levelling")) @@ -4471,7 +4472,7 @@ class MillingUI: ) self.allow_level_cb.setObjectName("mill_allow_level") - grid3.addWidget(self.allow_level_cb, 14, 0, 1, 2) + gen_grid.addWidget(self.allow_level_cb, 14, 0, 1, 2) # Size of trace segment on X axis segx_label = FCLabel('%s:' % _("Segment X size")) @@ -4487,8 +4488,8 @@ class MillingUI: self.segx_entry.setWrapping(True) self.segx_entry.setObjectName("mill_segx") - grid3.addWidget(segx_label, 16, 0) - grid3.addWidget(self.segx_entry, 16, 1) + gen_grid.addWidget(segx_label, 16, 0) + gen_grid.addWidget(self.segx_entry, 16, 1) # Size of trace segment on Y axis segy_label = FCLabel('%s:' % _("Segment Y size")) @@ -4504,8 +4505,8 @@ class MillingUI: self.segy_entry.setWrapping(True) self.segy_entry.setObjectName("mill_segy") - grid3.addWidget(segy_label, 18, 0) - grid3.addWidget(self.segy_entry, 18, 1) + gen_grid.addWidget(segy_label, 18, 0) + gen_grid.addWidget(self.segy_entry, 18, 1) self.oih = OptionalHideInputSection(self.allow_level_cb, [segx_label, self.segx_entry, segy_label, self.segy_entry]) @@ -4525,11 +4526,11 @@ class MillingUI: ) self.exclusion_cb.setObjectName("mill_exclusion") - grid3.addWidget(self.exclusion_cb, 20, 0, 1, 2) + gen_grid.addWidget(self.exclusion_cb, 20, 0, 1, 2) self.exclusion_frame = QtWidgets.QFrame() self.exclusion_frame.setContentsMargins(0, 0, 0, 0) - grid3.addWidget(self.exclusion_frame, 22, 0, 1, 2) + gen_grid.addWidget(self.exclusion_frame, 22, 0, 1, 2) self.exclusion_box = QtWidgets.QVBoxLayout() self.exclusion_box.setContentsMargins(0, 0, 0, 0) @@ -4616,7 +4617,7 @@ class MillingUI: # ------------------------------------------------------------------------------------------------------------ FCGridLayout.set_common_column_size( - [grid0, grid_title_tool_table, grid1, grid_add_tool, button_grid, grid2, grid3], 0) + [obj_grid, tool_title_grid, tool_grid, new_tool_grid, param_grid, gen_grid], 0) # ############################################################################################################# # Generate CNC Job object diff --git a/appPlugins/ToolNCC.py b/appPlugins/ToolNCC.py index 7ec6fec9..8935e062 100644 --- a/appPlugins/ToolNCC.py +++ b/appPlugins/ToolNCC.py @@ -4137,7 +4137,7 @@ class NccUI: self.type_obj_combo_label.setMinimumWidth(60) self.type_obj_radio = RadioSet([{'label': _("Geometry"), 'value': 'geometry'}, - {'label': _("Gerber"), 'value': 'gerber'}]) + {'label': _("Gerber"), 'value': 'gerber'}], compact=True) obj_grid.addWidget(self.type_obj_combo_label, 0, 0) obj_grid.addWidget(self.type_obj_radio, 0, 1) @@ -4344,7 +4344,7 @@ class NccUI: self.op_radio = RadioSet([ {"label": _("Clear"), "value": "clear"}, {"label": _("Isolation"), "value": "iso"} - ], orientation='horizontal', stretch=False) + ], orientation='horizontal', compact=True) self.op_radio.setObjectName("n_operation") par_grid.addWidget(self.op_label, 0, 0) @@ -4359,7 +4359,7 @@ class NccUI: ) self.milling_type_radio = RadioSet([{'label': _('Climb'), 'value': 'cl'}, - {'label': _('Conventional'), 'value': 'cv'}]) + {'label': _('Conventional'), 'value': 'cv'}], compact=True) self.milling_type_radio.setToolTip( _("Milling type:\n" "- climb / best for precision milling and to reduce tool usage\n" @@ -4406,7 +4406,7 @@ class NccUI: # {"label": _("Standard"), "value": "standard"}, # {"label": _("Seed-based"), "value": "seed"}, # {"label": _("Straight lines"), "value": "lines"} - # ], orientation='vertical', stretch=False) + # ], orientation='vertical', compact=True) self.ncc_method_combo = FCComboBox2() self.ncc_method_combo.addItems( @@ -4622,7 +4622,7 @@ class NccUI: ) self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'}, - {'label': _("Polygon"), 'value': 'polygon'}]) + {'label': _("Polygon"), 'value': 'polygon'}], compact=True) gen_grid.addWidget(self.area_shape_label, 14, 0) gen_grid.addWidget(self.area_shape_radio, 14, 1) diff --git a/appPlugins/ToolPaint.py b/appPlugins/ToolPaint.py index d3483c57..841df7f4 100644 --- a/appPlugins/ToolPaint.py +++ b/appPlugins/ToolPaint.py @@ -342,7 +342,7 @@ class ToolPaint(AppTool, Gerber): # }) # ## Init the GUI interface - self.ui.order_radio.set_value(self.app.defaults["tools_paint_order"]) + self.ui.paint_order_combo.set_value(self.app.defaults["tools_paint_order"]) self.ui.offset_entry.set_value(self.app.defaults["tools_paint_offset"]) self.ui.paintmethod_combo.set_value(self.app.defaults["tools_paint_method"]) self.ui.selectmethod_combo.set_value(self.app.defaults["tools_paint_selectmethod"]) @@ -700,7 +700,7 @@ class ToolPaint(AppTool, Gerber): }) def on_order_changed(self, order): - if order != 'no': + if order != 0: # Default order self.build_ui() def rebuild_ui(self): @@ -732,10 +732,10 @@ class ToolPaint(AppTool, Gerber): for k, v in self.paint_tools.items(): sorted_tools.append(float('%.*f' % (self.decimals, float(v['tooldia'])))) - order = self.ui.order_radio.get_value() - if order == 'fwd': + order = self.ui.paint_order_combo.get_value() + if order == 1: # "Forward" sorted_tools.sort(reverse=False) - elif order == 'rev': + elif order == 2: # "Reverse" sorted_tools.sort(reverse=True) else: pass @@ -1863,7 +1863,7 @@ class ToolPaint(AppTool, Gerber): prog_plot = True if self.app.defaults["tools_paint_plotting"] == 'progressive' else False name = outname if outname is not None else self.obj_name + "_paint" - order = order if order is not None else self.ui.order_radio.get_value() + order = order if order is not None else self.ui.paint_order_combo.get_value() tools_storage = self.paint_tools if tools_storage is None else tools_storage use_rest_strategy = rest if rest is not None else self.ui.rest_cb.get_value() @@ -1902,9 +1902,9 @@ class ToolPaint(AppTool, Gerber): old_disp_number = 0 # sort the tools if we have an order selected in the UI - if order == 'fwd': + if order == 1: # Forward sorted_tools.sort(reverse=False) - elif order == 'rev': + elif order == 2: # Reverse sorted_tools.sort(reverse=True) else: pass @@ -2674,7 +2674,7 @@ class ToolPaint(AppTool, Gerber): current_widget.currentIndexChanged.connect(self.form_to_storage) self.ui.rest_cb.stateChanged.connect(self.ui.on_rest_machining_check) - self.ui.order_radio.activated_custom[str].connect(self.on_order_changed) + self.ui.paint_order_combo.currentIndexChanged.connect(self.on_order_changed) def ui_disconnect(self): try: @@ -2733,7 +2733,7 @@ class ToolPaint(AppTool, Gerber): try: # if connected, disconnect the signal from the slot on item_changed as it creates issues - self.ui.order_radio.activated_custom[str].disconnect() + self.ui.paint_order_combo.currentIndexChanged.disconnect() except (TypeError, AttributeError): pass @@ -2944,8 +2944,8 @@ class PaintUI: self.tools_box.addWidget(obj_frame) # Grid Layout - grid0 = FCGridLayout(v_spacing=5, h_spacing=3) - obj_frame.setLayout(grid0) + obj_grid = FCGridLayout(v_spacing=5, h_spacing=3) + obj_frame.setLayout(obj_grid) # ############################################################################################################# # Type of object to be painted @@ -2960,10 +2960,10 @@ class PaintUI: self.type_obj_combo_label.setMinimumWidth(60) self.type_obj_radio = RadioSet([{'label': "Geometry", 'value': 'geometry'}, - {'label': "Gerber", 'value': 'gerber'}]) + {'label': "Gerber", 'value': 'gerber'}], compact=True) - grid0.addWidget(self.type_obj_combo_label, 0, 0) - grid0.addWidget(self.type_obj_radio, 0, 1) + obj_grid.addWidget(self.type_obj_combo_label, 0, 0) + obj_grid.addWidget(self.type_obj_radio, 0, 1) # ############################################################################################################# # The object to be painted @@ -2973,12 +2973,12 @@ class PaintUI: self.obj_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex())) self.obj_combo.is_last = True - grid0.addWidget(self.obj_combo, 2, 0, 1, 2) + obj_grid.addWidget(self.obj_combo, 2, 0, 1, 2) # separator_line = QtWidgets.QFrame() # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - # grid0.addWidget(separator_line, 5, 0, 1, 2) + # obj_grid.addWidget(separator_line, 5, 0, 1, 2) # ############################################################################################################# # Tool Table Frame @@ -2995,12 +2995,12 @@ class PaintUI: self.tools_box.addWidget(tt_frame) # Grid Layout - grid1 = FCGridLayout(v_spacing=5, h_spacing=3) - tt_frame.setLayout(grid1) + tool_grid = FCGridLayout(v_spacing=5, h_spacing=3) + tt_frame.setLayout(tool_grid) self.tools_table = FCTable(drag_drop=True) # self.tools_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) - grid1.addWidget(self.tools_table, 2, 0, 1, 2) + tool_grid.addWidget(self.tools_table, 2, 0, 1, 2) self.tools_table.setColumnCount(4) self.tools_table.setHorizontalHeaderLabels(['#', _('Diameter'), _('Shape'), '']) @@ -3036,25 +3036,18 @@ class PaintUI: "WARNING: using rest machining will automatically set the order\n" "in reverse and disable this control.")) - self.order_radio = RadioSet([{'label': _('No'), 'value': 'no'}, - {'label': _('Forward'), 'value': 'fwd'}, - {'label': _('Reverse'), 'value': 'rev'}]) - self.order_radio.setToolTip(_("This set the way that the tools in the tools table are used.\n" - "'No' --> means that the used order is the one in the tool table\n" - "'Forward' --> means that the tools will be ordered from small to big\n" - "'Reverse' --> means that the tools will ordered from big to small\n\n" - "WARNING: using rest machining will automatically set the order\n" - "in reverse and disable this control.")) + self.paint_order_combo = FCComboBox2() + self.paint_order_combo.addItems([_('Default'), _('Forward'), _('Reverse')]) - grid1.addWidget(self.order_label, 4, 0) - grid1.addWidget(self.order_radio, 4, 1) + tool_grid.addWidget(self.order_label, 4, 0) + tool_grid.addWidget(self.paint_order_combo, 4, 1) # ############################################################################## # ###################### ADD A NEW TOOL ######################################## # ############################################################################## self.add_tool_frame = QtWidgets.QFrame() self.add_tool_frame.setContentsMargins(0, 0, 0, 0) - grid1.addWidget(self.add_tool_frame, 6, 0, 1, 2) + tool_grid.addWidget(self.add_tool_frame, 6, 0, 1, 2) new_tool_grid = FCGridLayout(v_spacing=5, h_spacing=3) new_tool_grid.setContentsMargins(0, 0, 0, 0) @@ -3140,8 +3133,8 @@ class PaintUI: tt_frame = FCFrame() self.tools_box.addWidget(tt_frame) - par_grid = FCGridLayout(v_spacing=5, h_spacing=3) - tt_frame.setLayout(par_grid) + param_grid = FCGridLayout(v_spacing=5, h_spacing=3) + tt_frame.setLayout(param_grid) # Overlap ovlabel = FCLabel('%s:' % _('Overlap')) @@ -3161,8 +3154,8 @@ class PaintUI: self.paintoverlap_entry.setSingleStep(0.1) self.paintoverlap_entry.setObjectName('p_overlap') - par_grid.addWidget(ovlabel, 0, 0) - par_grid.addWidget(self.paintoverlap_entry, 0, 1) + param_grid.addWidget(ovlabel, 0, 0) + param_grid.addWidget(self.paintoverlap_entry, 0, 1) # Offset self.offset_label = FCLabel('%s:' % _('Offset')) @@ -3176,8 +3169,8 @@ class PaintUI: self.offset_entry.set_range(-10000.0000, 10000.0000) self.offset_entry.setObjectName('p_offset') - par_grid.addWidget(self.offset_label, 2, 0) - par_grid.addWidget(self.offset_entry, 2, 1) + param_grid.addWidget(self.offset_label, 2, 0) + param_grid.addWidget(self.offset_entry, 2, 1) # Method methodlabel = FCLabel('%s:' % _('Method')) @@ -3201,8 +3194,8 @@ class PaintUI: self.paintmethod_combo.setObjectName('p_method') - par_grid.addWidget(methodlabel, 4, 0) - par_grid.addWidget(self.paintmethod_combo, 4, 1) + param_grid.addWidget(methodlabel, 4, 0) + param_grid.addWidget(self.paintmethod_combo, 4, 1) # Connect lines self.pathconnect_cb = FCCheckBox('%s' % _("Connect")) @@ -3219,8 +3212,8 @@ class PaintUI: "to trim rough edges.") ) - par_grid.addWidget(self.pathconnect_cb, 6, 0) - par_grid.addWidget(self.paintcontour_cb, 6, 1) + param_grid.addWidget(self.pathconnect_cb, 6, 0) + param_grid.addWidget(self.paintcontour_cb, 6, 1) # ############################################################################################################# # Apply All Parameters Button @@ -3326,7 +3319,7 @@ class PaintUI: ) self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'}, - {'label': _("Polygon"), 'value': 'polygon'}]) + {'label': _("Polygon"), 'value': 'polygon'}], compact=True) gen_grid.addWidget(self.area_shape_label, 10, 0) gen_grid.addWidget(self.area_shape_radio, 10, 1) @@ -3334,6 +3327,8 @@ class PaintUI: self.area_shape_label.hide() self.area_shape_radio.hide() + FCGridLayout.set_common_column_size([obj_grid, tool_grid, new_tool_grid, param_grid, gen_grid], 0) + # ############################################################################################################# # Generate Paint Geometry Button # ############################################################################################################# @@ -3371,9 +3366,9 @@ class PaintUI: def on_rest_machining_check(self, state): if state: - self.order_radio.set_value('rev') + self.paint_order_combo.set_value(2) # Reverse self.order_label.setDisabled(True) - self.order_radio.setDisabled(True) + self.paint_order_combo.setDisabled(True) self.offset_label.hide() self.offset_entry.hide() @@ -3381,7 +3376,7 @@ class PaintUI: self.rest_offset_entry.show() else: self.order_label.setDisabled(False) - self.order_radio.setDisabled(False) + self.paint_order_combo.setDisabled(False) self.offset_label.show() self.offset_entry.show() diff --git a/appPlugins/ToolPunchGerber.py b/appPlugins/ToolPunchGerber.py index 0d7cbe06..44b3ec35 100644 --- a/appPlugins/ToolPunchGerber.py +++ b/appPlugins/ToolPunchGerber.py @@ -2134,7 +2134,7 @@ class PunchUI: {'label': _("Fixed Annular Ring"), 'value': 'ring'} ], orientation='vertical', - stretch=False) + compact=True) grid1.addWidget(self.method_punch, 0, 0, 1, 2) separator_line = QtWidgets.QFrame() diff --git a/app_Main.py b/app_Main.py index 6fd2d424..61e2e026 100644 --- a/app_Main.py +++ b/app_Main.py @@ -3120,7 +3120,7 @@ class App(QtCore.QObject): self.resize(600, 200) # self.setStyleSheet("background-image: url(share/flatcam_icon256.png); background-attachment: fixed") # self.setStyleSheet( - # "border-image: url(share/flatcam_icon256.png) 0 0 0 0 stretch stretch; " + # "border-image: url(share/flatcam_icon256.png) 0 0 0 0 compact compact; " # "background-attachment: fixed" # ) @@ -5394,7 +5394,7 @@ class App(QtCore.QObject): {"label": _("Quadrant 3"), "value": "tr"}, {"label": _("Quadrant 4"), "value": "tl"}, {"label": _("Center"), "value": "c"} - ], orientation='vertical', stretch=False) + ], orientation='vertical', compact=True) self.ref_radio.set_value(choice) grid0.addWidget(self.ref_radio, 0, 0) @@ -5667,7 +5667,7 @@ class App(QtCore.QObject): {"label": _("Bottom Right"), "value": "br"}, {"label": _("Top Right"), "value": "tr"}, {"label": _("Center"), "value": "c"} - ], orientation='vertical', stretch=False) + ], orientation='vertical', compact=True) self.ref_radio.set_value(choice) grid0.addWidget(self.ref_radio, 0, 0) diff --git a/defaults.py b/defaults.py index 18dc3adf..adc4f72a 100644 --- a/defaults.py +++ b/defaults.py @@ -520,7 +520,7 @@ class FlatCAMDefaults: # Paint Tool "tools_paint_tooldia": 0.3, - "tools_paint_order": 'rev', + "tools_paint_order": 2, # "Reverse" "tools_paint_overlap": 20, "tools_paint_offset": 0.0, "tools_paint_method": 0,