From 7e473beed096ab5dce95dc9835cba0e616543416 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 13 Oct 2024 19:58:27 +0200 Subject: [PATCH] PD: Disable PartDesign_CompDatums & PartDesign_CompSketches if dialog is open A group command is not disabled if its default command is disabled. This allows it to invoke the command when it should be impossible. To fix the problem override the isActive() method in the sub-classes CmdPartDesignCompDatums & CmdPartDesignCompSketches This fixes #16294 --- src/Mod/PartDesign/Gui/Command.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 1c6170a935..d45c2623d9 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -2460,7 +2460,7 @@ public: bool isActive() override { - return hasActiveDocument(); + return (hasActiveDocument() && !Gui::Control().activeDialog()); } }; @@ -2495,7 +2495,7 @@ public: bool isActive() override { - return hasActiveDocument(); + return (hasActiveDocument() && !Gui::Control().activeDialog()); } };