diff --git a/src/Gui/TaskCSysDragger.cpp b/src/Gui/TaskCSysDragger.cpp index df4efe35f5..99161881c4 100644 --- a/src/Gui/TaskCSysDragger.cpp +++ b/src/Gui/TaskCSysDragger.cpp @@ -406,6 +406,8 @@ void TaskTransform::setSelectionMode(SelectionMode mode) } selectionMode = mode; + + updateSpinBoxesReadOnlyStatus(); } TaskTransform::SelectionMode TaskTransform::getSelectionMode() const @@ -592,6 +594,24 @@ void TaskTransform::updateTransformOrigin() updateDraggerLabels(); } +void TaskTransform::updateSpinBoxesReadOnlyStatus() const +{ + const bool isReadOnly = selectionMode != SelectionMode::None; + + const auto controls = { + ui->xPositionSpinBox, + ui->yPositionSpinBox, + ui->zPositionSpinBox, + ui->xRotationSpinBox, + ui->yRotationSpinBox, + ui->zRotationSpinBox, + }; + + for (const auto& control : controls) { + control->setReadOnly(isReadOnly); + } +} + void TaskTransform::resetReferencePlacement() { referencePlacement = vp->getDraggerPlacement(); diff --git a/src/Gui/TaskCSysDragger.h b/src/Gui/TaskCSysDragger.h index dc037200e8..35b5af60b4 100644 --- a/src/Gui/TaskCSysDragger.h +++ b/src/Gui/TaskCSysDragger.h @@ -118,6 +118,7 @@ private: void updateInputLabels() const; void updateIncrements() const; void updateTransformOrigin(); + void updateSpinBoxesReadOnlyStatus() const; void resetReferencePlacement(); void resetReferenceRotation();