From e607b5757e6f2ccbb3f806d974741672a88fb963 Mon Sep 17 00:00:00 2001 From: Florian Foinant-Willig Date: Sun, 8 Dec 2024 20:50:01 +0100 Subject: [PATCH] PartDesign: Add Std_ToggleFreeze to context menu --- src/Mod/PartDesign/Gui/Workbench.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Workbench.cpp b/src/Mod/PartDesign/Gui/Workbench.cpp index bfacf1758d..4e3929e6b9 100644 --- a/src/Mod/PartDesign/Gui/Workbench.cpp +++ b/src/Mod/PartDesign/Gui/Workbench.cpp @@ -85,19 +85,22 @@ void Workbench::setupContextMenu(const char* recipient, Gui::MenuItem* item) con body = PartDesignGui::getBodyFor (feature, false, false, true); // lote of assertion so feature should be marked as a tip - if ( selection.size () == 1 && feature && ( - ( feature->isDerivedFrom ( PartDesign::Feature::getClassTypeId () ) && body ) || - ( feature->isDerivedFrom ( Part::Feature::getClassTypeId () ) && body && + if ( selection.size() == 1 && feature && body && ( + feature->isDerivedFrom() || + ( feature->isDerivedFrom() && body->BaseFeature.getValue() == feature ) ) ) { *item << "PartDesign_MoveTip"; } if (strcmp(recipient, "Tree") == 0) { - Gui::MDIView *activeView = Gui::Application::Instance->activeView(); - if ( !selection.empty() && activeView ) { + if (activeView ) { + if (feature && feature->isDerivedFrom()){ + *item << "Std_ToggleFreeze"; + } + bool docHaveBodies = activeView->getAppDocument()->countObjectsOfType ( PartDesign::Body::getClassTypeId () ) > 0; @@ -120,11 +123,9 @@ void Workbench::setupContextMenu(const char* recipient, Gui::MenuItem* item) con break; } } - if (addMoveFeature) { *item << "PartDesign_MoveFeature"; } - if (addMoveFeatureInTree) { *item << "PartDesign_MoveFeatureInTree"; }