From 28e1a3b6544ab3c104d125d0fdc3032d295d41ff Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Mon, 25 Aug 2025 19:36:47 +0200 Subject: [PATCH] PartDesign: Reorder fields in Hole dialog This makes order of fields in Hole Parameters more natural with typical input flow of the parameters, i.e. moves the size of the hole more to the top as it is the most important parameter. --- src/Mod/PartDesign/Gui/TaskHoleParameters.cpp | 11 +- src/Mod/PartDesign/Gui/TaskHoleParameters.ui | 312 +++++++++--------- 2 files changed, 168 insertions(+), 155 deletions(-) diff --git a/src/Mod/PartDesign/Gui/TaskHoleParameters.cpp b/src/Mod/PartDesign/Gui/TaskHoleParameters.cpp index 1093cabe0e..04bd12acad 100644 --- a/src/Mod/PartDesign/Gui/TaskHoleParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskHoleParameters.cpp @@ -81,11 +81,15 @@ TaskHoleParameters::TaskHoleParameters(ViewProviderHole* HoleView, QWidget* pare // read values from the hole properties auto pcHole = getObject(); bool isNone = std::string(pcHole->ThreadType.getValueAsString()) == "None"; + bool isThreaded = pcHole->Threaded.getValue(); + ui->labelThreading->setHidden(isNone); ui->labelHoleType->setHidden(isNone); ui->HoleType->setHidden(isNone); ui->ThreadSize->setHidden(isNone); ui->labelSize->setHidden(isNone); + ui->ThreadFit->setHidden(isNone || isThreaded); + ui->labelThreadClearance->setHidden(isNone || isThreaded); updateHoleTypeCombo(); ui->ThreadType->setCurrentIndex(pcHole->ThreadType.getValue()); @@ -165,10 +169,8 @@ TaskHoleParameters::TaskHoleParameters(ViewProviderHole* HoleView, QWidget* pare ui->TaperedAngle->setValue(pcHole->TaperedAngle.getValue()); ui->Reversed->setChecked(pcHole->Reversed.getValue()); - bool isThreaded = pcHole->Threaded.getValue(); bool isModeled = pcHole->ModelThread.getValue(); ui->ThreadGroupBox->setVisible(isThreaded); - ui->ClearanceWidget->setHidden(isNone || isThreaded); ui->UseCustomThreadClearance->setChecked(pcHole->UseCustomThreadClearance.getValue()); ui->CustomThreadClearance->setValue(pcHole->CustomThreadClearance.getValue()); ui->ThreadDepthType->setCurrentIndex(pcHole->ThreadDepthType.getValue()); @@ -285,7 +287,6 @@ void TaskHoleParameters::holeTypeChanged(int index) pcHole->ModelThread.setValue(isModeled); ui->ThreadGroupBox->setVisible(isThreaded); - ui->ClearanceWidget->setHidden(isThreaded); // update view not active if modeling threads // this will also ensure that the feature is recomputed. ui->UpdateView->setVisible(isModeled); @@ -656,9 +657,11 @@ void TaskHoleParameters::threadTypeChanged(int index) ui->ThreadGroupBox->setHidden(isNone || !isThreaded); ui->ThreadSize->setHidden(isNone); ui->labelSize->setHidden(isNone); + ui->labelThreading->setHidden(isNone); ui->labelHoleType->setHidden(isNone); ui->HoleType->setHidden(isNone); - ui->ClearanceWidget->setHidden(isNone || isThreaded); + ui->ThreadFit->setHidden(isNone || isThreaded); + ui->labelThreadClearance->setHidden(isNone || isThreaded); if (TypeClass == QByteArray("None")) { QString noneText = QStringLiteral("-"); diff --git a/src/Mod/PartDesign/Gui/TaskHoleParameters.ui b/src/Mod/PartDesign/Gui/TaskHoleParameters.ui index a8b90b77b9..6ee004d7e4 100644 --- a/src/Mod/PartDesign/Gui/TaskHoleParameters.ui +++ b/src/Mod/PartDesign/Gui/TaskHoleParameters.ui @@ -6,8 +6,8 @@ 0 0 - 366 - 924 + 414 + 945 @@ -33,10 +33,62 @@ 6 - + 10 + + + + + 0 + 0 + + + + Size + + + + + + + + 0 + 0 + + + + Qt::LayoutDirection::RightToLeft + + + Head type + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Standard + + + @@ -44,6 +96,29 @@ + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Cut type for screw heads + + + @@ -63,8 +138,8 @@ - - + + 0 @@ -72,14 +147,14 @@ - Qt::LayoutDirection::RightToLeft + Qt::LayoutDirection::LeftToRight - Head type + Depth type - + @@ -102,35 +177,6 @@ - - - - - 0 - 0 - - - - Qt::LayoutDirection::LeftToRight - - - Depth type - - - - - - - - 0 - 0 - - - - Cut type for screw heads - - - @@ -214,15 +260,15 @@ false + + mm + 0.000000000000000 0.100000000000000 - - mm - @@ -263,15 +309,15 @@ the screw's top below the surface false + + mm + 0.000000000000000 0.100000000000000 - - mm - @@ -333,12 +379,12 @@ the screw's top below the surface false - - 0.000000000000000 - deg + + 0.000000000000000 + @@ -431,12 +477,12 @@ account for the depth of blind holes false - - 0.000000000000000 - deg + + 0.000000000000000 + @@ -530,12 +576,12 @@ account for the depth of blind holes false - - 0.000000000000000 - mm + + 0.000000000000000 + @@ -598,12 +644,12 @@ over 90: larger hole radius at the bottom false - - 0.000000000000000 - deg + + 0.000000000000000 + @@ -611,57 +657,21 @@ over 90: larger hole radius at the bottom - + + + <b>Threading</b> + + + Qt::TextFormat::RichText + + + + + 0 - - - - - 0 - 0 - - - - Standard - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - Size - - - - - - - - 0 - 0 - - - - - @@ -680,13 +690,55 @@ over 90: larger hole radius at the bottom - + Hole type + + + + + 0 + 0 + + + + Clearance + + + + + + + + 0 + 0 + + + + Hole clearance +Only available for holes without thread + + + + Standard + + + + + Close + + + + + Wide + + + + @@ -697,7 +749,7 @@ over 90: larger hole radius at the bottom 0 - + 0 @@ -710,48 +762,6 @@ over 90: larger hole radius at the bottom 0 - - - - - 0 - 0 - - - - Clearance - - - - - - - - 0 - 0 - - - - Hole clearance -Only available for holes without thread - - - - Standard - - - - - Close - - - - - Wide - - - - @@ -770,7 +780,7 @@ Only available for holes without thread - + Thread @@ -1070,12 +1080,12 @@ Note that the calculation can take some time false - - 0.100000000000000 - mm + + 0.100000000000000 + @@ -1089,7 +1099,7 @@ Note that the calculation can take some time Gui::QuantitySpinBox - QDoubleSpinBox + QAbstractSpinBox
Gui/QuantitySpinBox.h