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.
This commit is contained in:
tetektoza
2025-04-24 19:28:11 +02:00
committed by Yorik van Havre
parent fec569f017
commit c91a0384de
2 changed files with 5 additions and 1 deletions

View File

@@ -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.

View File

@@ -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"