PartDesign Pad UI-fix

hide the custom direction fields if no custom direction is used, to
unclutter the UI.
This commit is contained in:
M G Berberich
2021-06-03 22:13:45 +02:00
parent 61ac0b4838
commit 82f1f5cc2b
2 changed files with 18 additions and 9 deletions

View File

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