- 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

@@ -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)