From 23ea8ce37b14b5477b0d8299050f3aa3904eebaf Mon Sep 17 00:00:00 2001 From: George Peden Date: Wed, 10 Sep 2025 19:08:59 -1000 Subject: [PATCH 1/5] Add U (rounded corners) and J (frame) keyboard shortcuts to rectangle hints - Add roundedCornersHint and frameHint constants - Include U and J shortcuts in all rectangle construction method states - Addresses issue #23815 for missing keyboard shortcuts in hints --- .../Sketcher/Gui/DrawSketchHandlerRectangle.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h index 8deb5ee289..3d7e14db7c 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h @@ -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( {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 From d524b9ceefbabf1d357042d6ec2aca4db7b710b6 Mon Sep 17 00:00:00 2001 From: George Peden Date: Wed, 10 Sep 2025 19:13:15 -1000 Subject: [PATCH 2/5] Add M (Mode) keyboard shortcut to arc slot hints - Add switchModeHint constant with M key - Include mode shortcut in all arc slot states (SeekFirst through SeekFourth) - Addresses issue #23815 for missing keyboard shortcuts in hints --- src/Mod/Sketcher/Gui/DrawSketchHandlerArcSlot.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcSlot.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcSlot.h index 4cb5ff8bf2..20e2eaa7b7 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcSlot.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcSlot.h @@ -97,27 +97,33 @@ public: { using enum Gui::InputHint::UserInput; + const Gui::InputHint switchModeHint {.message = tr("%1 switch mode"), .sequences = {KeyM}}; + return Gui::lookupHints(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, }}, }); } From 80290baaf6cc6ff4e7f05fa0d0abe4f16f53433d Mon Sep 17 00:00:00 2001 From: George Peden Date: Wed, 10 Sep 2025 19:34:53 -1000 Subject: [PATCH 3/5] Add mode-aware keyboard shortcuts to B-spline hints - Control Points mode: U/J for degree control (+ degree, - degree) - Knots mode: R for periodic toggle - Hints are now context-aware based on construction method - Addresses issue #23815 for missing keyboard shortcuts in hints --- src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h index 7858833e49..c886423834 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerBSpline.h @@ -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}}, }}, }); } From 343bd6c77c411ca72de2e44d48d37c6993f72e22 Mon Sep 17 00:00:00 2001 From: George Peden Date: Wed, 10 Sep 2025 19:59:49 -1000 Subject: [PATCH 4/5] Add keyboard shortcuts to fillet/chamfer hints - M key for switching between Fillet and Chamfer modes - U key for toggling preserve corner option - Hints are shown in all states (SeekFirst, SeekSecond, End) - Addresses issue #23815 for missing keyboard shortcuts in hints --- src/Mod/Sketcher/Gui/DrawSketchHandlerFillet.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerFillet.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerFillet.h index 1445b72e86..7bdd150e00 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerFillet.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerFillet.h @@ -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( 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}}, }); } }; From ed444318e446b7bb6a004725e3432c5fa061dec1 Mon Sep 17 00:00:00 2001 From: George Peden Date: Wed, 10 Sep 2025 20:40:18 -1000 Subject: [PATCH 5/5] Fix inconsistent keyboard shortcut hints in Rectangle tool - Add missing U (rounded corners) and J (frame) hints to ThreePoints method - Add missing U (rounded corners) and J (frame) hints to CenterAnd3Points method - Now all four construction methods show consistent keyboard shortcut hints - Addresses Copilot feedback on PR --- .../Sketcher/Gui/DrawSketchHandlerRectangle.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h index 3d7e14db7c..083ffd42cb 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h @@ -196,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 @@ -222,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, }}, }); }