PartDesign: Update counterbore min size in reaction to diameter changes (#20217)
Can't rely purely on `TaskHoleParameters::threadDiameterChanged` to update it since the signal is intentionally blocked while syncing state to GUI. Closes #19744
This commit is contained in:
@@ -128,7 +128,7 @@ TaskHoleParameters::TaskHoleParameters(ViewProviderHole* HoleView, QWidget* pare
|
||||
|| pcHole->HoleCutCustomValues.isReadOnly()
|
||||
);
|
||||
// HoleCutDiameter must not be smaller or equal than the Diameter
|
||||
ui->HoleCutDiameter->setMinimum(pcHole->Diameter.getValue() + 0.1);
|
||||
updateHoleCutLimits(pcHole);
|
||||
ui->HoleCutDiameter->setValue(pcHole->HoleCutDiameter.getValue());
|
||||
ui->HoleCutDiameter->setDisabled(pcHole->HoleCutDiameter.isReadOnly());
|
||||
ui->HoleCutDepth->setValue(pcHole->HoleCutDepth.getValue());
|
||||
@@ -731,8 +731,7 @@ void TaskHoleParameters::threadDiameterChanged(double value)
|
||||
if (auto hole = getObject<PartDesign::Hole>()) {
|
||||
hole->Diameter.setValue(value);
|
||||
|
||||
// HoleCutDiameter must not be smaller or equal than the Diameter
|
||||
ui->HoleCutDiameter->setMinimum(value + 0.1);
|
||||
updateHoleCutLimits(hole);
|
||||
|
||||
recomputeFeature();
|
||||
}
|
||||
@@ -838,6 +837,7 @@ void TaskHoleParameters::changedObject(const App::Document&, const App::Property
|
||||
else if (&Prop == &hole->Diameter) {
|
||||
ui->Diameter->setEnabled(true);
|
||||
updateSpinBox(ui->Diameter, hole->Diameter.getValue());
|
||||
updateHoleCutLimits(hole);
|
||||
}
|
||||
else if (&Prop == &hole->ThreadDirection) {
|
||||
ui->directionRightHand->setEnabled(true);
|
||||
@@ -1130,6 +1130,14 @@ void TaskHoleParameters::apply()
|
||||
isApplying = false;
|
||||
}
|
||||
|
||||
void TaskHoleParameters::updateHoleCutLimits(PartDesign::Hole* hole)
|
||||
{
|
||||
constexpr double minHoleCutDifference = 0.1;
|
||||
// HoleCutDiameter must not be smaller or equal than the Diameter
|
||||
ui->HoleCutDiameter->setMinimum(hole->Diameter.getValue() + minHoleCutDifference);
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// TaskDialog
|
||||
|
||||
@@ -126,6 +126,7 @@ protected:
|
||||
|
||||
private:
|
||||
void onSelectionChanged(const Gui::SelectionChanges &msg) override;
|
||||
void updateHoleCutLimits(PartDesign::Hole* hole);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user