- added to the application an older contribution by another user: Columnar Layout for the Preferences Tab. It can be set in Preferences -> General -> GUI section

This commit is contained in:
Marius Stanciu
2022-03-12 01:05:54 +02:00
committed by Marius
parent 320a76761e
commit 37e31b0159
19 changed files with 136 additions and 43 deletions

View File

@@ -77,6 +77,7 @@ class PreferencesUIManager:
"global_layout": self.ui.general_pref_form.general_gui_group.layout_combo,
"global_hover_shape": self.ui.general_pref_form.general_gui_group.hover_cb,
"global_selection_shape": self.ui.general_pref_form.general_gui_group.selection_cb,
"global_gui_layout": self.ui.general_pref_form.general_gui_group.gui_lay_combo,
"global_sel_fill": self.ui.general_pref_form.general_gui_group.sf_color_entry,
"global_sel_line": self.ui.general_pref_form.general_gui_group.sl_color_entry,

View File

@@ -75,4 +75,4 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI):
gcode_grid.addWidget(self.annotation_cb, 2, 0, 1, 2)
# self.layout.addStretch()
self.layout.addStretch(2)

View File

@@ -6,11 +6,17 @@ from appGUI.preferences.cncjob.CNCJobGenPrefGroupUI import CNCJobGenPrefGroupUI
from appGUI.preferences.cncjob.CNCJobEditorPrefGroupUI import CNCJobEditorPrefGroupUI
from appGUI.preferences.cncjob.CNCJobPPGroupUI import CNCJobPPGroupUI
from appGUI.ColumnarFlowLayout import ColumnarFlowLayout
class CNCJobPreferencesUI(QtWidgets.QWidget):
def __init__(self, app, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
if app.defaults['global_gui_layout'] == 0:
self.layout = QtWidgets.QHBoxLayout()
else:
self.layout = ColumnarFlowLayout()
self.setLayout(self.layout)
self.cncjob_gen_group = CNCJobGenPrefGroupUI(app=app)
@@ -31,6 +37,7 @@ class CNCJobPreferencesUI(QtWidgets.QWidget):
vlay.addWidget(self.cncjob_opt_group)
vlay.addWidget(self.cncjob_adv_opt_group)
vlay.addWidget(self.cncjob_pp_group)
vlay.addStretch()
self.layout.addWidget(self.cncjob_gen_group)
self.layout.addLayout(vlay)

View File

@@ -6,6 +6,8 @@ from appGUI.preferences.excellon.ExcellonAdvOptPrefGroupUI import ExcellonAdvOpt
from appGUI.preferences.excellon.ExcellonOptPrefGroupUI import ExcellonOptPrefGroupUI
from appGUI.preferences.excellon.ExcellonGenPrefGroupUI import ExcellonGenPrefGroupUI
from appGUI.ColumnarFlowLayout import ColumnarFlowLayout
import gettext
import appTranslation as fcTranslate
import builtins
@@ -19,7 +21,10 @@ class ExcellonPreferencesUI(QtWidgets.QWidget):
def __init__(self, app, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
if app.defaults['global_gui_layout'] == 0:
self.layout = QtWidgets.QHBoxLayout()
else:
self.layout = ColumnarFlowLayout()
self.setLayout(self.layout)
self.excellon_gen_group = ExcellonGenPrefGroupUI(app=app)

View File

@@ -2,7 +2,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui
from PyQt6.QtCore import QSettings
from appGUI.GUIElements import RadioSet, FCCheckBox, FCComboBox, FCSliderWithSpinner, FCColorEntry, FCLabel, \
FCGridLayout, FCFrame
FCGridLayout, FCFrame, FCComboBox2
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
@@ -129,6 +129,20 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
)
grid0.addWidget(self.selection_cb, 12, 0, 1, 3)
# Select the GUI layout
self.ui_lay_lbl = FCLabel('%s:' % _('GUI Layout'))
self.ui_lay_lbl.setToolTip(
_("Select a GUI layout for the Preferences.\n"
"Can be:\n"
"'Normal' -> a normal and compact layout.\n"
"'Columnar' -> a layout the auto-adjust such\n"
"that columns are preferentially showed in columns")
)
self.gui_lay_combo = FCComboBox2()
self.gui_lay_combo.addItems([_("Normal"), _("Columnar")])
grid0.addWidget(self.ui_lay_lbl, 14, 0)
grid0.addWidget(self.gui_lay_combo, 14, 1, 1, 2)
# #############################################################################################################
# Grid1 Frame
# #############################################################################################################

View File

@@ -4,6 +4,8 @@ from appGUI.preferences.general.GeneralAppPrefGroupUI import GeneralAppPrefGroup
from appGUI.preferences.general.GeneralAPPSetGroupUI import GeneralAPPSetGroupUI
from appGUI.preferences.general.GeneralGUIPrefGroupUI import GeneralGUIPrefGroupUI
from appGUI.ColumnarFlowLayout import ColumnarFlowLayout
import gettext
import appTranslation as fcTranslate
import builtins
@@ -16,17 +18,23 @@ if '_' not in builtins.__dict__:
class GeneralPreferencesUI(QtWidgets.QWidget):
def __init__(self, app, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
if app.defaults['global_gui_layout'] == 0:
self.layout = QtWidgets.QHBoxLayout()
else:
self.layout = ColumnarFlowLayout()
self.setLayout(self.layout)
self.general_app_group = GeneralAppPrefGroupUI(app=app)
self.general_app_group.setMinimumWidth(250)
# self.general_app_group.setMaximumWidth(250)
self.general_gui_group = GeneralGUIPrefGroupUI(app=app)
self.general_gui_group.setMinimumWidth(250)
# self.general_gui_group.setMaximumWidth(250)
self.general_app_set_group = GeneralAPPSetGroupUI(app=app)
self.general_app_set_group.setMinimumWidth(250)
# self.general_app_set_group.setMaximumWidth(250)
self.layout.addWidget(self.general_app_group)
self.layout.addWidget(self.general_gui_group)

View File

@@ -159,7 +159,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
FCGridLayout.set_common_column_size([plot_grid, opt_grid, obj_grid, fuse_grid], 0)
self.layout.addStretch()
self.layout.addStretch(1)
current_platform = platform.architecture()[0]
if current_platform == '64bit':

View File

@@ -6,6 +6,8 @@ from appGUI.preferences.geometry.GeometryExpPrefGroupUI import GeometryExpPrefGr
from appGUI.preferences.geometry.GeometryOptPrefGroupUI import GeometryOptPrefGroupUI
from appGUI.preferences.geometry.GeometryGenPrefGroupUI import GeometryGenPrefGroupUI
from appGUI.ColumnarFlowLayout import ColumnarFlowLayout
import gettext
import appTranslation as fcTranslate
import builtins
@@ -19,7 +21,10 @@ class GeometryPreferencesUI(QtWidgets.QWidget):
def __init__(self, app, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
if app.defaults['global_gui_layout'] == 0:
self.layout = QtWidgets.QHBoxLayout()
else:
self.layout = ColumnarFlowLayout()
self.setLayout(self.layout)
self.geometry_gen_group = GeometryGenPrefGroupUI(app=app)
@@ -27,11 +32,11 @@ class GeometryPreferencesUI(QtWidgets.QWidget):
self.geometry_exp_group = GeometryExpPrefGroupUI(app=app)
self.geometry_exp_group.setMinimumWidth(220)
self.geometry_opt_group = GeometryOptPrefGroupUI(app=app)
self.geometry_opt_group.setMinimumWidth(300)
self.geometry_opt_group.setMinimumWidth(250)
self.geometry_adv_opt_group = GeometryAdvOptPrefGroupUI(app=app)
self.geometry_adv_opt_group.setMinimumWidth(270)
self.geometry_editor_group = GeometryEditorPrefGroupUI(app=app)
self.geometry_editor_group.setMinimumWidth(250)
self.geometry_editor_group.setMinimumWidth(270)
self.layout.addWidget(self.geometry_gen_group)

View File

@@ -6,6 +6,8 @@ from appGUI.preferences.gerber.GerberAdvOptPrefGroupUI import GerberAdvOptPrefGr
from appGUI.preferences.gerber.GerberOptPrefGroupUI import GerberOptPrefGroupUI
from appGUI.preferences.gerber.GerberGenPrefGroupUI import GerberGenPrefGroupUI
from appGUI.ColumnarFlowLayout import ColumnarFlowLayout
import gettext
import appTranslation as fcTranslate
import builtins
@@ -19,19 +21,22 @@ class GerberPreferencesUI(QtWidgets.QWidget):
def __init__(self, app, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
if app.defaults['global_gui_layout'] == 0:
self.layout = QtWidgets.QHBoxLayout()
else:
self.layout = ColumnarFlowLayout()
self.setLayout(self.layout)
self.gerber_gen_group = GerberGenPrefGroupUI(app=app)
self.gerber_gen_group.setMinimumWidth(200)
self.gerber_gen_group.setMinimumWidth(250)
self.gerber_opt_group = GerberOptPrefGroupUI(app=app)
self.gerber_opt_group.setMinimumWidth(250)
self.gerber_exp_group = GerberExpPrefGroupUI(app=app)
self.gerber_exp_group.setMinimumWidth(230)
self.gerber_adv_opt_group = GerberAdvOptPrefGroupUI(app=app)
self.gerber_adv_opt_group.setMinimumWidth(200)
self.gerber_adv_opt_group.setMinimumWidth(220)
self.gerber_editor_group = GerberEditorPrefGroupUI(app=app)
self.gerber_editor_group.setMinimumWidth(200)
self.gerber_editor_group.setMinimumWidth(270)
self.vlay = QtWidgets.QVBoxLayout()
self.vlay.addWidget(self.gerber_opt_group)

View File

@@ -10,6 +10,8 @@ from appGUI.preferences.tools.Tools2QRCodePrefGroupUI import Tools2QRCodePrefGro
from appGUI.preferences.tools.Tools2OptimalPrefGroupUI import Tools2OptimalPrefGroupUI
from appGUI.preferences.tools.Tools2RulesCheckPrefGroupUI import Tools2RulesCheckPrefGroupUI
from appGUI.ColumnarFlowLayout import ColumnarFlowLayout
import gettext
import appTranslation as fcTranslate
import builtins
@@ -22,35 +24,38 @@ class Plugins2PreferencesUI(QtWidgets.QWidget):
def __init__(self,app, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
if app.defaults['global_gui_layout'] == 0:
self.layout = QtWidgets.QHBoxLayout()
else:
self.layout = ColumnarFlowLayout()
self.setLayout(self.layout)
self.tools2_checkrules_group = Tools2RulesCheckPrefGroupUI(app=app)
self.tools2_checkrules_group.setMinimumWidth(150)
self.tools2_checkrules_group.setMinimumWidth(250)
self.tools2_optimal_group = Tools2OptimalPrefGroupUI(app=app)
self.tools2_optimal_group.setMinimumWidth(220)
self.tools2_optimal_group.setMinimumWidth(250)
self.tools2_qrcode_group = Tools2QRCodePrefGroupUI(app=app)
self.tools2_qrcode_group.setMinimumWidth(220)
self.tools2_qrcode_group.setMinimumWidth(280)
self.tools2_cfill_group = Tools2CThievingPrefGroupUI(app=app)
self.tools2_cfill_group.setMinimumWidth(220)
self.tools2_cfill_group.setMinimumWidth(250)
self.tools2_fiducials_group = Tools2FiducialsPrefGroupUI(app=app)
self.tools2_fiducials_group.setMinimumWidth(220)
self.tools2_fiducials_group.setMinimumWidth(250)
self.tools2_cal_group = Tools2CalPrefGroupUI(app=app)
self.tools2_cal_group.setMinimumWidth(220)
self.tools2_cal_group.setMinimumWidth(250)
self.tools2_edrills_group = Tools2EDrillsPrefGroupUI(app=app)
self.tools2_edrills_group.setMinimumWidth(220)
self.tools2_edrills_group.setMinimumWidth(250)
self.tools2_punch_group = Tools2PunchGerberPrefGroupUI(app=app)
self.tools2_punch_group.setMinimumWidth(220)
self.tools2_punch_group.setMinimumWidth(250)
self.tools2_invert_group = Tools2InvertPrefGroupUI(app=app)
self.tools2_invert_group.setMinimumWidth(220)
self.tools2_invert_group.setMinimumWidth(250)
self.vlay = QtWidgets.QVBoxLayout()
self.vlay.addWidget(self.tools2_checkrules_group)

View File

@@ -7,6 +7,8 @@ from appGUI.preferences.tools.ToolsNCCPrefGroupUI import ToolsNCCPrefGroupUI
from appGUI.preferences.tools.ToolsPaintPrefGroupUI import ToolsPaintPrefGroupUI
from appGUI.preferences.tools.ToolsISOPrefGroupUI import ToolsISOPrefGroupUI
from appGUI.ColumnarFlowLayout import ColumnarFlowLayout
import gettext
import appTranslation as fcTranslate
import builtins
@@ -20,23 +22,26 @@ class PluginsEngravingPreferencesUI(QtWidgets.QWidget):
def __init__(self, app, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
if app.defaults['global_gui_layout'] == 0:
self.layout = QtWidgets.QHBoxLayout()
else:
self.layout = ColumnarFlowLayout()
self.setLayout(self.layout)
self.tools_iso_group = ToolsISOPrefGroupUI(app=app)
self.tools_iso_group.setMinimumWidth(220)
self.tools_iso_group.setMinimumWidth(270)
self.tools_ncc_group = ToolsNCCPrefGroupUI(app=app)
self.tools_ncc_group.setMinimumWidth(220)
self.tools_ncc_group.setMinimumWidth(270)
self.tools_paint_group = ToolsPaintPrefGroupUI(app=app)
self.tools_paint_group.setMinimumWidth(220)
self.tools_paint_group.setMinimumWidth(250)
self.tools_2sided_group = Tools2sidedPrefGroupUI(app=app)
self.tools_2sided_group.setMinimumWidth(220)
self.tools_2sided_group.setMinimumWidth(250)
self.tools_level_group = ToolsLevelPrefGroupUI(app=app)
self.tools_level_group.setMinimumWidth(220)
self.tools_level_group.setMinimumWidth(250)
self.vlay = QtWidgets.QVBoxLayout()
self.vlay.addWidget(self.tools_iso_group)

View File

@@ -13,6 +13,9 @@ from appGUI.preferences.tools.ToolsFilmPrefGroupUI import ToolsFilmPrefGroupUI
from appGUI.preferences.tools.ToolsCutoutPrefGroupUI import ToolsCutoutPrefGroupUI
from appGUI.preferences.tools.ToolsDrillPrefGroupUI import ToolsDrillPrefGroupUI
from appGUI.preferences.tools.ToolsMillPrefGroupUI import ToolsMillPrefGroupUI
from appGUI.ColumnarFlowLayout import ColumnarFlowLayout
import gettext
import appTranslation as fcTranslate
import builtins
@@ -26,38 +29,41 @@ class PluginsPreferencesUI(QtWidgets.QWidget):
def __init__(self, app, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
if app.defaults['global_gui_layout'] == 0:
self.layout = QtWidgets.QHBoxLayout()
else:
self.layout = ColumnarFlowLayout()
self.setLayout(self.layout)
self.tools_drill_group = ToolsDrillPrefGroupUI(app=app)
self.tools_drill_group.setMinimumWidth(180)
self.tools_drill_group.setMinimumWidth(250)
self.tools_mill_group = ToolsMillPrefGroupUI(app=app)
self.tools_mill_group.setMinimumWidth(180)
self.tools_mill_group.setMinimumWidth(250)
self.tools_cutout_group = ToolsCutoutPrefGroupUI(app=app)
self.tools_cutout_group.setMinimumWidth(220)
self.tools_cutout_group.setMinimumWidth(250)
self.tools_film_group = ToolsFilmPrefGroupUI(app=app)
self.tools_film_group.setMinimumWidth(220)
self.tools_film_group.setMinimumWidth(250)
self.tools_panelize_group = ToolsPanelizePrefGroupUI(app=app)
self.tools_panelize_group.setMinimumWidth(220)
self.tools_panelize_group.setMinimumWidth(250)
self.tools_calculators_group = ToolsCalculatorsPrefGroupUI(app=app)
self.tools_calculators_group.setMinimumWidth(220)
self.tools_calculators_group.setMinimumWidth(250)
self.tools_transform_group = ToolsTransformPrefGroupUI(app=app)
self.tools_transform_group.setMinimumWidth(200)
self.tools_transform_group.setMinimumWidth(250)
self.tools_solderpaste_group = ToolsSolderpastePrefGroupUI(app=app)
self.tools_solderpaste_group.setMinimumWidth(200)
self.tools_solderpaste_group.setMinimumWidth(250)
self.tools_markers_group = ToolsMarkersPrefGroupUI(app=app)
self.tools_markers_group.setMinimumWidth(200)
self.tools_markers_group.setMinimumWidth(250)
self.tools_sub_group = ToolsSubPrefGroupUI(app=app)
self.tools_sub_group.setMinimumWidth(200)
self.tools_sub_group.setMinimumWidth(250)
self.vlay = QtWidgets.QVBoxLayout()
self.vlay.addWidget(self.tools_drill_group)

View File

@@ -359,4 +359,4 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
FCGridLayout.set_common_column_size([par_grid, tool_grid, gen_grid], 0)
# self.layout.addStretch()
self.layout.addStretch(1)

View File

@@ -357,4 +357,4 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
FCGridLayout.set_common_column_size([par_grid, tool_grid, gen_grid], 0)
# self.layout.addStretch()
self.layout.addStretch(1)

View File

@@ -6,12 +6,17 @@ from appGUI.preferences.utilities.FAGrbPrefGroupUI import FAGrbPrefGroupUI
from appGUI.preferences.utilities.FAGcoPrefGroupUI import FAGcoPrefGroupUI
from appGUI.preferences.utilities.FAExcPrefGroupUI import FAExcPrefGroupUI
from appGUI.ColumnarFlowLayout import ColumnarFlowLayout
class UtilPreferencesUI(QtWidgets.QWidget):
def __init__(self, app, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
if app.defaults['global_gui_layout'] == 0:
self.layout = QtWidgets.QHBoxLayout()
else:
self.layout = ColumnarFlowLayout()
self.setLayout(self.layout)
self.fa_excellon_group = FAExcPrefGroupUI(app=app)