Gui: Disable controls when selecting origin in transform dialog
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -118,6 +118,7 @@ private:
|
||||
void updateInputLabels() const;
|
||||
void updateIncrements() const;
|
||||
void updateTransformOrigin();
|
||||
void updateSpinBoxesReadOnlyStatus() const;
|
||||
|
||||
void resetReferencePlacement();
|
||||
void resetReferenceRotation();
|
||||
|
||||
Reference in New Issue
Block a user