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
This commit is contained in:
George Peden
2025-09-20 12:26:03 -07:00
committed by Chris Hennes
parent c6e7976af5
commit 603f84fbae

View File

@@ -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<std::string> SubNames)
: specialConstraint(SpecialConstraint::None)
, availableConstraint(AvailableConstraint::FIRST)
@@ -1984,20 +1986,25 @@ public:
std::list<Gui::InputHint> 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}}};
}
}