From 82f1f5cc2bc258f7f6c4a650b363b535bb740074 Mon Sep 17 00:00:00 2001 From: M G Berberich Date: Thu, 3 Jun 2021 22:13:45 +0200 Subject: [PATCH] PartDesign Pad UI-fix hide the custom direction fields if no custom direction is used, to unclutter the UI. --- src/Mod/PartDesign/Gui/TaskPadParameters.cpp | 13 +++++++++---- src/Mod/PartDesign/Gui/TaskPadParameters.ui | 14 +++++++++----- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/Mod/PartDesign/Gui/TaskPadParameters.cpp b/src/Mod/PartDesign/Gui/TaskPadParameters.cpp index 27851ad86a..4c03086235 100644 --- a/src/Mod/PartDesign/Gui/TaskPadParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPadParameters.cpp @@ -104,7 +104,8 @@ TaskPadParameters::TaskPadParameters(ViewProviderPad *PadView, QWidget *parent, // Fill data into dialog elements ui->lengthEdit->setValue(l); ui->lengthEdit2->setValue(l2); - ui->groupBoxDirection->setChecked(useCustom); + ui->checkBoxDirection->setChecked(useCustom); + onDirectionToggled(useCustom); ui->checkBoxAlongDirection->setChecked(alongCustom); ui->XDirectionEdit->setValue(xs); ui->YDirectionEdit->setValue(ys); @@ -158,7 +159,7 @@ TaskPadParameters::TaskPadParameters(ViewProviderPad *PadView, QWidget *parent, this, SLOT(onLength2Changed(double))); connect(ui->checkBoxAlongDirection, SIGNAL(toggled(bool)), this, SLOT(onAlongSketchNormalChanged(bool))); - connect(ui->groupBoxDirection, SIGNAL(toggled(bool)), + connect(ui->checkBoxDirection, SIGNAL(toggled(bool)), this, SLOT(onDirectionToggled(bool))); connect(ui->XDirectionEdit, SIGNAL(valueChanged(double)), this, SLOT(onXDirectionEditChanged(double))); @@ -323,8 +324,12 @@ void TaskPadParameters::onDirectionToggled(bool on) pcPad->UseCustomVector.setValue(on); // dis/enable length direction ui->checkBoxAlongDirection->setEnabled(on); - if (!on) + if (on) { + ui->groupBoxDirection->show(); + } else { ui->checkBoxAlongDirection->setChecked(!on); + ui->groupBoxDirection->hide(); + } recomputeFeature(); // the calculation of the sketch's normal vector is done in FeaturePad.cpp // if this vector was used for the recomputation we must fill the direction @@ -473,7 +478,7 @@ bool TaskPadParameters::getAlongSketchNormal(void) const bool TaskPadParameters::getCustom(void) const { - return ui->groupBoxDirection->isChecked(); + return ui->checkBoxDirection->isChecked(); } double TaskPadParameters::getXDirection(void) const diff --git a/src/Mod/PartDesign/Gui/TaskPadParameters.ui b/src/Mod/PartDesign/Gui/TaskPadParameters.ui index a2c73db1c2..b0a680b51c 100644 --- a/src/Mod/PartDesign/Gui/TaskPadParameters.ui +++ b/src/Mod/PartDesign/Gui/TaskPadParameters.ui @@ -7,7 +7,7 @@ 0 0 280 - 373 + 497 @@ -51,6 +51,13 @@ + + + + Use custom direction + + + @@ -60,11 +67,8 @@ Use custom vector for pad direction otherwise the sketch plane's normal vector will be used - - Use custom direction - - true + false