From c91a0384de7c517b433c2adf69408eda7823e825 Mon Sep 17 00:00:00 2001 From: tetektoza Date: Thu, 24 Apr 2025 19:28:11 +0200 Subject: [PATCH] Draft: Finish command if user deselected Chained Mode As the title says - currently, if user deselects Chained Mode, they can't exit it without using ESC key for example, as the old behavior of ContinueMode is kept under it. So, this patch finishes the command if user has deselected it, at the same time finishing previous chain. --- src/Mod/Draft/DraftGui.py | 4 ++++ src/Mod/Draft/draftguitools/gui_dimensions.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index fb8abc2faf..942bb8b621 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -940,6 +940,10 @@ class DraftToolBar: params.set_param("ChainedMode", bool(val)) self.chainedMode = bool(val) self.continueCmd.setEnabled(not val) + if val == False: + # If user has deselected the checkbox, reactive the command + # which will result in closing it + FreeCAD.activeDraftCommand.Activated() # val=-1 is used to temporarily switch to relativeMode and disable the checkbox. # val=-2 is used to switch back. diff --git a/src/Mod/Draft/draftguitools/gui_dimensions.py b/src/Mod/Draft/draftguitools/gui_dimensions.py index e32d55ae5b..0f8f4dd04f 100644 --- a/src/Mod/Draft/draftguitools/gui_dimensions.py +++ b/src/Mod/Draft/draftguitools/gui_dimensions.py @@ -74,7 +74,7 @@ class Dimension(gui_base_original.Creator): def __init__(self): super().__init__() self.max = 2 - self.chain = None + self.chain = None # Last chain's leg in ChainMode self.contMode = None self.dir = None self.featureName = "Dimension"