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

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>280</width>
<height>373</height>
<height>497</height>
</rect>
</property>
<property name="windowTitle">
@@ -51,6 +51,13 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBoxDirection">
<property name="text">
<string>Use custom direction</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxDirection">
<property name="enabled">
@@ -60,11 +67,8 @@
<string>Use custom vector for pad direction otherwise
the sketch plane's normal vector will be used</string>
</property>
<property name="title">
<string>Use custom direction</string>
</property>
<property name="checkable">
<bool>true</bool>
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">