diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 1c02119356..1378fd09e0 100644 --- a/pcbnew/board.cpp +++ b/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; } diff --git a/pcbnew/board.h b/pcbnew/board.h index aeeb7e5408..a72a8e6f29 100644 --- a/pcbnew/board.h +++ b/pcbnew/board.h @@ -1119,7 +1119,6 @@ public: bool create : 1; bool ungroup : 1; bool removeItems : 1; - bool enter : 1; }; /** diff --git a/pcbnew/tools/group_tool.cpp b/pcbnew/tools/group_tool.cpp index 7c194e3208..85f525bb89 100644 --- a/pcbnew/tools/group_tool.cpp +++ b/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; } diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index b5c018f307..448c1386bc 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/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 );