From ebd7faac82c7e54bce088717840c3017e9a9293a Mon Sep 17 00:00:00 2001 From: longrackslabs Date: Sun, 21 Sep 2025 14:02:46 -0700 Subject: [PATCH] Add 'or click to finish' to Sketcher_Dimension hints After selecting first geometry, users can now see that they can click empty space to finish the dimension and set its value, rather than having to pick additional geometry. Added PICK_SECOND_POINT_OR_EDGE_OR_CLICK_TO_FINISH constant and updated all selection cases in DrawSketchHandlerDimension::getToolHints(). --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 3e58bcf633..aa597f70fd 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -1735,6 +1735,7 @@ public: static constexpr const char* PICK_EDGE = "%1 pick edge"; static constexpr const char* PICK_POINT_OR_EDGE = "%1 pick point or edge"; static constexpr const char* PICK_SECOND_POINT_OR_EDGE = "%1 pick second point or edge"; + static constexpr const char* PICK_SECOND_POINT_OR_EDGE_OR_CLICK_TO_FINISH = "%1 pick second point or edge, or click to finish"; static constexpr const char* PLACE_DIMENSION = "%1 place dimension"; static constexpr const char* MODE_HINT = "%1 switch mode"; explicit DrawSketchHandlerDimension(std::vector SubNames) @@ -1990,20 +1991,20 @@ std::list getToolHints() const override { {QObject::tr(MODE_HINT), {Gui::InputHint::UserInput::KeyM}}}; } else if (selPoints.size() == 1 && selLine.empty() && selCircleArc.empty() && selEllipseAndCo.empty() && selSplineAndCo.empty()) { // Single point - can add more points, lines, circles, etc. - return {{QObject::tr(PICK_SECOND_POINT_OR_EDGE), {Gui::InputHint::UserInput::MouseLeft}}, + return {{QObject::tr(PICK_SECOND_POINT_OR_EDGE_OR_CLICK_TO_FINISH), {Gui::InputHint::UserInput::MouseLeft}}, {QObject::tr(MODE_HINT), {Gui::InputHint::UserInput::KeyM}}}; } else if (selLine.size() == 1 && selPoints.empty() && selCircleArc.empty() && selEllipseAndCo.empty() && selSplineAndCo.empty()) { // Single line - can add more points, lines, circles, etc. - return {{QObject::tr(PICK_SECOND_POINT_OR_EDGE), {Gui::InputHint::UserInput::MouseLeft}}, + return {{QObject::tr(PICK_SECOND_POINT_OR_EDGE_OR_CLICK_TO_FINISH), {Gui::InputHint::UserInput::MouseLeft}}, {QObject::tr(MODE_HINT), {Gui::InputHint::UserInput::KeyM}}}; } else if (selCircleArc.size() == 1 && selPoints.empty() && selLine.empty() && selEllipseAndCo.empty() && selSplineAndCo.empty()) { // Single circle/arc - can add more points, lines, circles, etc. - return {{QObject::tr(PICK_SECOND_POINT_OR_EDGE), {Gui::InputHint::UserInput::MouseLeft}}, + return {{QObject::tr(PICK_SECOND_POINT_OR_EDGE_OR_CLICK_TO_FINISH), {Gui::InputHint::UserInput::MouseLeft}}, {QObject::tr(MODE_HINT), {Gui::InputHint::UserInput::KeyM}}}; } else { // Multiple selections or complex combinations - check if more selections are possible // For now, assume more selections are possible unless we have a complete constraint - return {{QObject::tr(PICK_SECOND_POINT_OR_EDGE), {Gui::InputHint::UserInput::MouseLeft}}, + return {{QObject::tr(PICK_SECOND_POINT_OR_EDGE_OR_CLICK_TO_FINISH), {Gui::InputHint::UserInput::MouseLeft}}, {QObject::tr(MODE_HINT), {Gui::InputHint::UserInput::KeyM}}}; } }