From ff062983efeac589e9a9afa0ad6ef4e8c49405e1 Mon Sep 17 00:00:00 2001 From: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com> Date: Thu, 14 Aug 2025 22:49:30 +0200 Subject: [PATCH] remove edit value option from non dimensional constraints --- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index d89cf6a45f..098e3443fe 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -4135,6 +4135,7 @@ void ViewProviderSketch::generateContextMenu() if (selection.size() > 0) { const std::vector SubNames = selection[0].getSubNames(); const Sketcher::SketchObject* obj; + bool shouldAddChangeConstraintValue = false; if (selection[0].getObject()->isDerivedFrom()) { obj = static_cast(selection[0].getObject()); for (auto& name : SubNames) { @@ -4166,6 +4167,14 @@ void ViewProviderSketch::generateContextMenu() ++selectedEndPoints; } else if (name.substr(0, 4) == "Cons") { + if (selectedConstraints == 0) { + int ConstrId = Sketcher::PropertyConstraintList::getIndexFromConstraintName(name); + const Constraint *constraint = obj->Constraints[ConstrId]; + shouldAddChangeConstraintValue = constraint->isDimensional(); + } + else { + shouldAddChangeConstraintValue = false; + } ++selectedConstraints; } else if (name.substr(2, 5) == "Axis") { @@ -4294,7 +4303,7 @@ void ViewProviderSketch::generateContextMenu() // context menu if only constraints are selected else if (selectedConstraints >= 1) { - if (selectedConstraints == 1) { + if (shouldAddChangeConstraintValue) { menu << "Sketcher_ChangeDimensionConstraint"; } menu << "Sketcher_ToggleDrivingConstraint"