From 77b7af3e60d99ad69dabe41c569cf554432160cb Mon Sep 17 00:00:00 2001 From: Uwe Date: Sat, 25 Feb 2023 04:09:12 +0100 Subject: [PATCH] [Gui] remove unused help button from preferences dialog - is by default in the title bar of Qt dialogs, has to be removed explicitly when unused - also fix too long code lines --- src/Gui/DlgPreferencesImp.cpp | 2 ++ src/Gui/DlgSettingsViewColor.cpp | 4 ++-- src/Gui/Tree.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Gui/DlgPreferencesImp.cpp b/src/Gui/DlgPreferencesImp.cpp index d251c489d3..cca16af18f 100644 --- a/src/Gui/DlgPreferencesImp.cpp +++ b/src/Gui/DlgPreferencesImp.cpp @@ -74,6 +74,8 @@ DlgPreferencesImp::DlgPreferencesImp(QWidget* parent, Qt::WindowFlags fl) int length = QtTools::horizontalAdvance(fm, longestGroupName()); ui->listBox->setFixedWidth(Base::clamp(length + 20, 108, 120)); ui->listBox->setGridSize(QSize(108, 75)); + // remove unused help button + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &DlgPreferencesImp::onButtonBoxClicked); diff --git a/src/Gui/DlgSettingsViewColor.cpp b/src/Gui/DlgSettingsViewColor.cpp index a03c8c1601..90a3ce9ec6 100644 --- a/src/Gui/DlgSettingsViewColor.cpp +++ b/src/Gui/DlgSettingsViewColor.cpp @@ -21,7 +21,6 @@ ***************************************************************************/ #include "PreCompiled.h" - #ifndef _PreComp_ # include #endif @@ -45,7 +44,8 @@ DlgSettingsViewColor::DlgSettingsViewColor(QWidget* parent) ui->setupUi(this); ui->HighlightColor->setEnabled(ui->checkBoxPreselection->isChecked()); ui->SelectionColor->setEnabled(ui->checkBoxSelection->isChecked()); - connect(ui->SwitchGradientColors, &QPushButton::pressed, this, &DlgSettingsViewColor::onSwitchGradientColorsPressed); + connect(ui->SwitchGradientColors, &QPushButton::pressed, this, + &DlgSettingsViewColor::onSwitchGradientColorsPressed); } /** diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 85d50ca154..ea2edb584d 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -3235,7 +3235,8 @@ void DocumentItem::slotInEdit(const Gui::ViewProviderDocumentObject& v) { (void)v; - ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/TreeView"); + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/TreeView"); unsigned long col = hGrp->GetUnsigned("TreeEditColor", 4294902015); QColor color((col >> 24) & 0xff, (col >> 16) & 0xff, (col >> 8) & 0xff);