Skip to content

Commit

Permalink
PartDesign: Add Std_ToggleFreeze to context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
FlachyJoe authored and chennes committed Dec 16, 2024
1 parent fa327ec commit e607b57
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Mod/PartDesign/Gui/Workbench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PartDesign::Feature>() ||
( feature->isDerivedFrom<Part::Feature>() &&
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<PartDesign::Body>()){
*item << "Std_ToggleFreeze";
}

bool docHaveBodies = activeView->getAppDocument()->countObjectsOfType (
PartDesign::Body::getClassTypeId () ) > 0;

Expand All @@ -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";
}
Expand Down

0 comments on commit e607b57

Please sign in to comment.