Browse Source

Move Enter Group for easier access.

7.0
Alex 3 years ago
parent
commit
22917860ef
  1. 1
      pcbnew/board.cpp
  2. 1
      pcbnew/board.h
  3. 4
      pcbnew/tools/group_tool.cpp
  4. 4
      pcbnew/tools/pcb_selection_tool.cpp

1
pcbnew/board.cpp

@ -2130,7 +2130,6 @@ BOARD::GroupLegalOpsField BOARD::GroupLegalOps( const PCB_SELECTION& selection )
legalOps.create = true;
legalOps.removeItems = hasMember;
legalOps.ungroup = hasGroup;
legalOps.enter = hasGroup && selection.Size() == 1;
return legalOps;
}

1
pcbnew/board.h

@ -1119,7 +1119,6 @@ public:
bool create : 1;
bool ungroup : 1;
bool removeItems : 1;
bool enter : 1;
};
/**

4
pcbnew/tools/group_tool.cpp

@ -45,7 +45,6 @@ public:
Add( PCB_ACTIONS::group );
Add( PCB_ACTIONS::ungroup );
Add( PCB_ACTIONS::removeFromGroup );
Add( PCB_ACTIONS::groupEnter );
}
ACTION_MENU* create() const override
@ -69,7 +68,6 @@ private:
Enable( PCB_ACTIONS::group.GetUIId(), legalOps.create );
Enable( PCB_ACTIONS::ungroup.GetUIId(), legalOps.ungroup );
Enable( PCB_ACTIONS::removeFromGroup.GetUIId(), legalOps.removeItems );
Enable( PCB_ACTIONS::groupEnter.GetUIId(), legalOps.enter );
}
};
@ -207,7 +205,7 @@ int GROUP_TOOL::PickNewMember( const TOOL_EVENT& aEvent )
}
canvas()->SetStatusPopup( nullptr );
return 0;
}

4
pcbnew/tools/pcb_selection_tool.cpp

@ -173,6 +173,9 @@ bool PCB_SELECTION_TOOL::Init()
return !cfg->GetHighlightNetCodes().empty();
};
auto groupEnterCondition =
SELECTION_CONDITIONS::Count( 1 ) && SELECTION_CONDITIONS::HasType( PCB_GROUP_T );
auto inGroupCondition =
[this] ( const SELECTION& )
{
@ -187,6 +190,7 @@ bool PCB_SELECTION_TOOL::Init()
// "Cancel" goes at the top of the context menu when a tool is active
menu.AddItem( ACTIONS::cancelInteractive, activeToolCondition, 1 );
menu.AddItem( PCB_ACTIONS::groupEnter, groupEnterCondition, 1 );
menu.AddItem( PCB_ACTIONS::groupLeave, inGroupCondition, 1 );
menu.AddItem( PCB_ACTIONS::clearHighlight, haveHighlight, 1 );

Loading…
Cancel
Save