Gui: Organize tree view preferences (#21867)

* feat #18649: Organize tree options in one single preference page
-Removed tree view related code from all DlgSettingsAdvanced files
-Added Font size and Item Background Padding to DlgSettingsUI

Co-authored-by: Tiago Cardoso <tiagomiguelcardoso@tecnico.ulisboa.pt>

* fix #18649: Organize tree options in one single preference page
-Added new line at the end of file DlgSettingsAdvanced.cpp
-Added new line at the end of file DlgSettingsAdvanced.py
-Added new line at the end of file DlgSettingsUI.ui
-Delete trailing space on file DlgSettingsAdvanced.py
-Delete extra line on file DlgSettingsAdvanced.h

Co-authored-by: Tiago Almeida <tiago.c.almeida@tecnico.ulisboa.pt>

* Gui: Remove over-advanced UI prefs

---------

Co-authored-by: Tiago Cardoso <tiagomiguelcardoso@tecnico.ulisboa.pt>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
This commit is contained in:
Tiago-Almeida007
2025-09-27 03:33:04 +01:00
committed by GitHub
parent 919f5fd265
commit 0d48351c9e
5 changed files with 49 additions and 100 deletions

View File

@@ -52,45 +52,6 @@ DlgSettingsAdvanced::DlgSettingsAdvanced(QWidget* parent)
auto layout = new QVBoxLayout(this);
// Auto generated code (Tools/params_utils.py:420)
groupTreeview = new QGroupBox(this);
layout->addWidget(groupTreeview);
auto layoutHorizTreeview = new QHBoxLayout(groupTreeview);
auto layoutTreeview = new QGridLayout();
layoutHorizTreeview->addLayout(layoutTreeview);
layoutHorizTreeview->addStretch();
// Auto generated code (Tools/params_utils.py:433)
labelItemBackgroundPadding = new QLabel(this);
layoutTreeview->addWidget(labelItemBackgroundPadding, 0, 0);
ItemBackgroundPadding = new Gui::PrefSpinBox(this);
layoutTreeview->addWidget(ItemBackgroundPadding, 0, 1);
ItemBackgroundPadding->setValue(Gui::TreeParams::defaultItemBackgroundPadding());
ItemBackgroundPadding->setEntryName("ItemBackgroundPadding");
ItemBackgroundPadding->setParamGrpPath("TreeView");
// Auto generated code (Tools/params_utils.py:1135)
ItemBackgroundPadding->setMinimum(0);
ItemBackgroundPadding->setMaximum(100);
ItemBackgroundPadding->setSingleStep(1);
ItemBackgroundPadding->setAlignment(Qt::AlignRight);
ItemBackgroundPadding->setSuffix(QLatin1String(" px"));
// Auto generated code (Tools/params_utils.py:433)
labelFontSize = new QLabel(this);
layoutTreeview->addWidget(labelFontSize, 1, 0);
FontSize = new Gui::PrefSpinBox(this);
layoutTreeview->addWidget(FontSize, 1, 1);
FontSize->setValue(Gui::TreeParams::defaultFontSize());
FontSize->setEntryName("FontSize");
FontSize->setParamGrpPath("TreeView");
// Auto generated code (Tools/params_utils.py:1135)
FontSize->setMinimum(0);
FontSize->setMaximum(100);
FontSize->setSingleStep(1);
FontSize->setAlignment(Qt::AlignRight);
FontSize->setSuffix(QLatin1String(" pt"));
// Auto generated code (Tools/params_utils.py:420)
groupOverlay = new QGroupBox(this);
layout->addWidget(groupOverlay);
@@ -379,8 +340,6 @@ DlgSettingsAdvanced::~DlgSettingsAdvanced()
void DlgSettingsAdvanced::saveSettings()
{
// Auto generated code (Tools/params_utils.py:461)
ItemBackgroundPadding->onSave();
FontSize->onSave();
DockOverlayWheelDelay->onSave();
DockOverlayAlphaRadius->onSave();
DockOverlayCheckNaviCube->onSave();
@@ -406,8 +365,6 @@ void DlgSettingsAdvanced::saveSettings()
void DlgSettingsAdvanced::loadSettings()
{
// Auto generated code (Tools/params_utils.py:449)
ItemBackgroundPadding->onRestore();
FontSize->onRestore();
DockOverlayWheelDelay->onRestore();
DockOverlayAlphaRadius->onRestore();
DockOverlayCheckNaviCube->onRestore();
@@ -433,13 +390,6 @@ void DlgSettingsAdvanced::loadSettings()
void DlgSettingsAdvanced::retranslateUi()
{
setWindowTitle(QObject::tr("Advanced"));
groupTreeview->setTitle(QObject::tr("Tree view"));
ItemBackgroundPadding->setToolTip(QApplication::translate("TreeParams", Gui::TreeParams::docItemBackgroundPadding()));
labelItemBackgroundPadding->setText(QObject::tr("Item background padding"));
labelItemBackgroundPadding->setToolTip(ItemBackgroundPadding->toolTip());
FontSize->setToolTip(QApplication::translate("TreeParams", Gui::TreeParams::docFontSize()));
labelFontSize->setText(QObject::tr("Font size"));
labelFontSize->setToolTip(FontSize->toolTip());
groupOverlay->setTitle(QObject::tr("Overlay"));
DockOverlayWheelDelay->setToolTip(QApplication::translate("OverlayParams", Gui::OverlayParams::docDockOverlayWheelDelay()));
labelDockOverlayWheelDelay->setText(QObject::tr("Delay mouse wheel pass through"));

View File

@@ -71,13 +71,6 @@ protected:
private:
// Auto generated code (Tools/params_utils.py:400)
QGroupBox * groupTreeview = nullptr;
QLabel *labelItemBackgroundPadding = nullptr;
Gui::PrefSpinBox *ItemBackgroundPadding = nullptr;
QLabel *labelFontSize = nullptr;
Gui::PrefSpinBox *FontSize = nullptr;
// Auto generated code (Tools/params_utils.py:400)
QGroupBox * groupOverlay = nullptr;
QLabel *labelDockOverlayWheelDelay = nullptr;

View File

@@ -32,7 +32,7 @@ from params_utils import auto_comment
sys.path.append(path.join(path.dirname(
path.dirname(path.dirname(path.abspath(__file__)))), 'Gui'))
import OverlayParams, TreeParams
import OverlayParams
Title = 'Advanced'
NameSpace = 'Gui'
@@ -41,13 +41,8 @@ ClassDoc = 'Preference dialog for various advanced UI settings'
UserInit = 'init();'
_OverlayParams = { param.name : param for param in OverlayParams.Params }
_TreeParams = { param.name : param for param in TreeParams.Params }
ParamGroup = (
('Tree view', [_TreeParams[name] for name in (
'ItemBackgroundPadding',
'FontSize',
)]),
('Overlay', [_OverlayParams[name] for name in (
'DockOverlayWheelDelay',
@@ -80,3 +75,4 @@ def declare_end():
def define():
params_utils.preference_dialog_define(sys.modules[__name__])

View File

@@ -68,8 +68,8 @@ void DlgSettingsUI::saveSettings()
ui->OverlayStyleSheets->onSave();
// Tree View
ui->fontSizeSpinBox->onSave();
ui->iconSizeSpinBox->onSave();
ui->rowSpacingSpinBox->onSave();
ui->resizableColumnsCheckBox->onSave();
ui->showVisibilityIconCheckBox->onSave();
ui->hideDescriptionCheckBox->onSave();
@@ -97,8 +97,8 @@ void DlgSettingsUI::loadSettings()
ui->ThemeAccentColor3->onRestore();
// Tree View
ui->fontSizeSpinBox->onRestore();
ui->iconSizeSpinBox->onRestore();
ui->rowSpacingSpinBox->onRestore();
ui->resizableColumnsCheckBox->onRestore();
ui->showVisibilityIconCheckBox->onRestore();
ui->hideDescriptionCheckBox->onRestore();

View File

@@ -227,6 +227,34 @@
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::PrefSpinBox" name="fontSizeSpinBox">
<property name="toolTip">
<string>Font size override, set to 0 for the default value.</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="suffix">
<string> pt</string>
</property>
<property name="value">
<number>0</number>
</property>
<property name="prefPath" stdset="0">
<cstring>TreeView</cstring>
</property>
<property name="prefEntry" stdset="0">
<cstring>FontSize</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefSpinBox" name="iconSizeSpinBox">
<property name="toolTip">
<string>Icon size override, set to 0 for the default value.</string>
@@ -245,17 +273,8 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="rowSpacingLabel">
<property name="text">
<string>Additional row spacing</string>
</property>
<property name="buddy">
<cstring>rowSpacingSpinBox</cstring>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<widget class="Gui::PrefCheckBox" name="resizableColumnsCheckBox">
<property name="toolTip">
<string>Allow tree view columns to be manually resized.</string>
@@ -271,7 +290,7 @@
</property>
</widget>
</item>
<item row="0" column="0">
<item row="1" column="0">
<widget class="QLabel" name="iconSizeLabel">
<property name="text">
<string>Icon size</string>
@@ -281,26 +300,17 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefSpinBox" name="rowSpacingSpinBox">
<property name="toolTip">
<string>Additional spacing for tree view rows. Bigger values will increase row item heights.</string>
<item row="0" column="0">
<widget class="QLabel" name="fontSizeLabel">
<property name="text">
<string>Font size</string>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>ItemSpacing</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>TreeView</cstring>
<property name="buddy">
<cstring>fontSizeSpinBox</cstring>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="2" column="0" colspan="2">
<widget class="Gui::PrefCheckBox" name="showVisibilityIconCheckBox">
<property name="toolTip">
<string>Displays an eye icon in front of the tree view items, showing their visibility status. When clicked the visibility is toggled.</string>
@@ -385,7 +395,7 @@
<string>Overlay</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<item row="2" column="0">
<widget class="Gui::PrefCheckBox" name="hideTabBarCheckBox">
<property name="toolTip">
<string>Hide tab bar in dock overlay</string>
@@ -404,7 +414,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="0">
<widget class="Gui::PrefCheckBox" name="hintShowTabBarCheckBox">
<property name="toolTip">
<string>Show tab bar on mouse over when auto hide</string>
@@ -420,7 +430,7 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="4" column="0">
<widget class="Gui::PrefCheckBox" name="hidePropertyViewScrollBarCheckBox">
<property name="toolTip">
<string>Hide property view scroll bar in dock overlay</string>
@@ -436,7 +446,7 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="5" column="0">
<widget class="Gui::PrefCheckBox" name="overlayAutoHideCheckBox">
<property name="toolTip">
<string>Automatically hide overlaid dock panels when in non 3D view (e.g. TechDraw or Spreadsheet)</string>
@@ -455,7 +465,7 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="6" column="0">
<widget class="Gui::PrefCheckBox" name="mouseClickPassThroughCheckBox">
<property name="toolTip">
<string>Auto mouse click through transparent part of dock overlay.</string>
@@ -474,7 +484,7 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="7" column="0">
<widget class="Gui::PrefCheckBox" name="mouseWheelPassThroughCheckBox">
<property name="toolTip">
<string>Automatically passes mouse wheel events through the transparent areas of an overlay panel</string>
@@ -566,8 +576,8 @@
<tabstop>ThemeAccentColor3</tabstop>
<tabstop>StyleSheets</tabstop>
<tabstop>OverlayStyleSheets</tabstop>
<tabstop>fontSizeSpinBox</tabstop>
<tabstop>iconSizeSpinBox</tabstop>
<tabstop>rowSpacingSpinBox</tabstop>
<tabstop>resizableColumnsCheckBox</tabstop>
<tabstop>showVisibilityIconCheckBox</tabstop>
<tabstop>hideDescriptionCheckBox</tabstop>