Gui: Disable controls when selecting origin in transform dialog

This commit is contained in:
Kacper Donat
2024-12-22 18:44:28 +01:00
parent f1ae9ac435
commit 7b267ffbd1
2 changed files with 21 additions and 0 deletions

View File

@@ -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();

View File

@@ -118,6 +118,7 @@ private:
void updateInputLabels() const;
void updateIncrements() const;
void updateTransformOrigin();
void updateSpinBoxesReadOnlyStatus() const;
void resetReferencePlacement();
void resetReferenceRotation();