From 115f31897672b1f231c1bbe54dbac8c230460dde Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 29 Sep 2018 09:14:02 -0700 Subject: [PATCH] pcbnew: Avoid double-separators in context menu (cherry picked from commit a81e3c2b13655401d8c13126134b879e8628f4b3) --- pcbnew/tools/edit_tool.cpp | 4 +++- pcbnew/tools/pcb_editor_control.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 6513475b7c..2c20c9b7d2 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -317,19 +317,21 @@ bool EDIT_TOOL::Init() menu.AddItem( PCB_ACTIONS::createArray, SELECTION_CONDITIONS::NotEmpty ); + menu.AddSeparator( SELECTION_CONDITIONS::NotEmpty ); menu.AddItem( PCB_ACTIONS::copyToClipboard, SELECTION_CONDITIONS::NotEmpty ); menu.AddItem( PCB_ACTIONS::cutToClipboard, SELECTION_CONDITIONS::NotEmpty ); // Selection tool handles the context menu for some other tools, such as the Picker. // Don't add things like Paste when another tool is active. menu.AddItem( PCB_ACTIONS::pasteFromClipboard, noActiveToolCondition ); - menu.AddSeparator( noActiveToolCondition ); // Mirror only available in modedit + menu.AddSeparator( editingModuleCondition && SELECTION_CONDITIONS::NotEmpty ); menu.AddItem( PCB_ACTIONS::mirror, editingModuleCondition && SELECTION_CONDITIONS::NotEmpty ); menu.AddItem( PCB_ACTIONS::createPadFromShapes, editingModuleCondition && SELECTION_CONDITIONS::NotEmpty ); menu.AddItem( PCB_ACTIONS::explodePadToShapes, editingModuleCondition && SELECTION_CONDITIONS::NotEmpty ); // Footprint actions + menu.AddSeparator( singleModuleCondition ); menu.AddItem( PCB_ACTIONS::editFootprintInFpEditor, singleModuleCondition ); menu.AddItem( PCB_ACTIONS::updateFootprints, singleModuleCondition ); menu.AddItem( PCB_ACTIONS::exchangeFootprints, singleModuleCondition ); diff --git a/pcbnew/tools/pcb_editor_control.cpp b/pcbnew/tools/pcb_editor_control.cpp index 8370c46287..8b59111c9f 100644 --- a/pcbnew/tools/pcb_editor_control.cpp +++ b/pcbnew/tools/pcb_editor_control.cpp @@ -215,6 +215,7 @@ public: SetIcon( locked_xpm ); SetTitle( _( "Locking" ) ); + AppendSeparator(); Add( PCB_ACTIONS::lock ); Add( PCB_ACTIONS::unlock ); Add( PCB_ACTIONS::toggleLock );