Merge pull request #23837 from longrackslabs/feature/sketcher-keyboard-shortcuts-hints-23815
Feature/sketcher keyboard shortcuts hints 23815
This commit is contained in:
@@ -97,27 +97,33 @@ public:
|
||||
{
|
||||
using enum Gui::InputHint::UserInput;
|
||||
|
||||
const Gui::InputHint switchModeHint {.message = tr("%1 switch mode"), .sequences = {KeyM}};
|
||||
|
||||
return Gui::lookupHints<SelectMode>(state(),
|
||||
{
|
||||
{.state = SelectMode::SeekFirst,
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 pick slot center"), {MouseLeft}},
|
||||
switchModeHint,
|
||||
}},
|
||||
{.state = SelectMode::SeekSecond,
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 pick slot radius"), {MouseLeft}},
|
||||
switchModeHint,
|
||||
}},
|
||||
{.state = SelectMode::SeekThird,
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 pick slot angle"), {MouseLeft}},
|
||||
switchModeHint,
|
||||
}},
|
||||
{.state = SelectMode::SeekFourth,
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 pick slot width"), {MouseLeft}},
|
||||
switchModeHint,
|
||||
}},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -420,6 +420,8 @@ private:
|
||||
{
|
||||
{tr("%1 pick first control point"), {MouseLeft}},
|
||||
switchModeHint,
|
||||
{tr("%1 + degree"), {KeyU}},
|
||||
{tr("%1 - degree"), {KeyJ}},
|
||||
}},
|
||||
{.state = {ConstructionMethod::ControlPoints, SelectMode::SeekSecond},
|
||||
.hints =
|
||||
@@ -427,6 +429,8 @@ private:
|
||||
{tr("%1 pick next control point"), {MouseLeft}},
|
||||
{tr("%1 finish B-spline"), {MouseRight}},
|
||||
switchModeHint,
|
||||
{tr("%1 + degree"), {KeyU}},
|
||||
{tr("%1 - degree"), {KeyJ}},
|
||||
}},
|
||||
|
||||
// Knots method
|
||||
@@ -435,6 +439,7 @@ private:
|
||||
{
|
||||
{tr("%1 pick first knot"), {MouseLeft}},
|
||||
switchModeHint,
|
||||
{tr("%1 toggle periodic"), {KeyR}},
|
||||
}},
|
||||
{.state = {ConstructionMethod::Knots, SelectMode::SeekSecond},
|
||||
.hints =
|
||||
@@ -442,6 +447,7 @@ private:
|
||||
{tr("%1 pick next knot"), {MouseLeft}},
|
||||
{tr("%1 finish B-spline"), {MouseRight}},
|
||||
switchModeHint,
|
||||
{tr("%1 toggle periodic"), {KeyR}},
|
||||
}},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -414,17 +414,25 @@ public:
|
||||
{
|
||||
using enum Gui::InputHint::UserInput;
|
||||
|
||||
const Gui::InputHint switchModeHint {.message = tr("%1 switch mode"), .sequences = {KeyM}};
|
||||
const Gui::InputHint preserveCornerHint {.message = tr("%1 toggle preserve corner"),
|
||||
.sequences = {KeyU}};
|
||||
|
||||
return Gui::lookupHints<SelectMode>(
|
||||
state(),
|
||||
{
|
||||
{.state = SelectMode::SeekFirst,
|
||||
.hints = {{tr("%1 pick first edge or point", "Sketcher Fillet/Chamfer: hint"),
|
||||
{MouseLeft}}}},
|
||||
.hints = {{tr("%1 pick first edge or point"), {MouseLeft}},
|
||||
switchModeHint,
|
||||
preserveCornerHint}},
|
||||
{.state = SelectMode::SeekSecond,
|
||||
.hints = {{tr("%1 pick second edge", "Sketcher Fillet/Chamfer: hint"),
|
||||
{MouseLeft}}}},
|
||||
.hints = {{tr("%1 pick second edge"), {MouseLeft}},
|
||||
switchModeHint,
|
||||
preserveCornerHint}},
|
||||
{.state = SelectMode::End,
|
||||
.hints = {{tr("%1 create fillet", "Sketcher Fillet/Chamfer: hint"), {MouseLeft}}}},
|
||||
.hints = {{tr("%1 create fillet"), {MouseLeft}},
|
||||
switchModeHint,
|
||||
preserveCornerHint}},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -115,6 +115,9 @@ private:
|
||||
using enum Gui::InputHint::UserInput;
|
||||
|
||||
const Gui::InputHint switchHint {.message = tr("%1 switch mode"), .sequences = {KeyM}};
|
||||
const Gui::InputHint roundedCornersHint {.message = tr("%1 toggle rounded corners"),
|
||||
.sequences = {KeyU}};
|
||||
const Gui::InputHint frameHint {.message = tr("%1 toggle frame"), .sequences = {KeyJ}};
|
||||
|
||||
return Gui::lookupHints<State>(
|
||||
{constructionMethod(), state()},
|
||||
@@ -125,24 +128,32 @@ private:
|
||||
{
|
||||
{tr("%1 pick first corner"), {MouseLeft}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::Diagonal, SelectMode::SeekSecond},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 pick opposite corner"), {MouseLeft}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::Diagonal, SelectMode::SeekThird},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 set corner radius or frame thickness"), {MouseMove}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::Diagonal, SelectMode::SeekFourth},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 set frame thickness"), {MouseMove}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
|
||||
// CenterAndCorner method
|
||||
@@ -151,24 +162,32 @@ private:
|
||||
{
|
||||
{tr("%1 pick center"), {MouseLeft}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::CenterAndCorner, SelectMode::SeekSecond},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 pick corner"), {MouseLeft}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::CenterAndCorner, SelectMode::SeekThird},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 set corner radius or frame thickness"), {MouseMove}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::CenterAndCorner, SelectMode::SeekFourth},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 set frame thickness"), {MouseMove}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
|
||||
// ThreePoints method
|
||||
@@ -177,24 +196,32 @@ private:
|
||||
{
|
||||
{tr("%1 pick first corner"), {MouseLeft}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::ThreePoints, SelectMode::SeekSecond},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 pick second corner"), {MouseLeft}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::ThreePoints, SelectMode::SeekThird},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 pick third corner"), {MouseLeft}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::ThreePoints, SelectMode::SeekFourth},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 set corner radius or frame thickness"), {MouseMove}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
|
||||
// CenterAnd3Points method
|
||||
@@ -203,24 +230,32 @@ private:
|
||||
{
|
||||
{tr("%1 pick center"), {MouseLeft}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::CenterAnd3Points, SelectMode::SeekSecond},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 pick first corner"), {MouseLeft}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::CenterAnd3Points, SelectMode::SeekThird},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 pick second corner"), {MouseLeft}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
{.state = {ConstructionMethod::CenterAnd3Points, SelectMode::SeekFourth},
|
||||
.hints =
|
||||
{
|
||||
{tr("%1 set corner radius or frame thickness"), {MouseMove}},
|
||||
switchHint,
|
||||
roundedCornersHint,
|
||||
frameHint,
|
||||
}},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user