From 603f84fbae5de6658f69a82b00a9a18c46070621 Mon Sep 17 00:00:00 2001 From: George Peden Date: Sat, 20 Sep 2025 12:26:03 -0700 Subject: [PATCH] Add MODE_HINT to dimension tool - Add MODE_HINT constant to DrawSketchHandlerDimension class - Shows 'switch mode' hint for M key in dimension tool - Addresses reviewer feedback for missing M key hint --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 0a95dcae9c..38ee925df2 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -1022,6 +1022,7 @@ public: static constexpr const char* PICK_LINE = "%1 pick line"; static constexpr const char* PICK_POINT = "%1 pick point"; static constexpr const char* PLACE_DIMENSION = "%1 place dimension"; + static constexpr const char* MODE_HINT = "%1 switch mode"; explicit DrawSketchHandlerGenConstraint(CmdSketcherConstraint* _cmd) : cmd(_cmd) @@ -1735,6 +1736,7 @@ public: 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* PLACE_DIMENSION = "%1 place dimension"; + static constexpr const char* MODE_HINT = "%1 switch mode"; explicit DrawSketchHandlerDimension(std::vector SubNames) : specialConstraint(SpecialConstraint::None) , availableConstraint(AvailableConstraint::FIRST) @@ -1984,20 +1986,25 @@ public: std::list getToolHints() const override { if (selectionEmpty()) { - return {{QObject::tr(PICK_POINT_OR_EDGE), {Gui::InputHint::UserInput::MouseLeft}}}; + return {{QObject::tr(PICK_POINT_OR_EDGE), {Gui::InputHint::UserInput::MouseLeft}}, + {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), {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), {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), {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), {Gui::InputHint::UserInput::MouseLeft}}, + {QObject::tr(MODE_HINT), {Gui::InputHint::UserInput::KeyM}}}; } }