diff --git a/pcbnew/tools/board_editor_control.cpp b/pcbnew/tools/board_editor_control.cpp index 298518ce96..1404dfeecf 100644 --- a/pcbnew/tools/board_editor_control.cpp +++ b/pcbnew/tools/board_editor_control.cpp @@ -1473,7 +1473,10 @@ int BOARD_EDITOR_CONTROL::EditFpInFpEditor( const TOOL_EVENT& aEvent ) auto editor = (FOOTPRINT_EDIT_FRAME*) editFrame->Kiway().Player( FRAME_FOOTPRINT_EDITOR, true ); - editor->LoadFootprintFromBoard( fp ); + if( aEvent.IsAction( &PCB_ACTIONS::editFpInFpEditor ) ) + editor->LoadFootprintFromBoard( fp ); + else if( aEvent.IsAction( &PCB_ACTIONS::editLibFpInFpEditor ) ) + editor->LoadFootprintFromLibrary( fp->GetFPID() ); editor->Show( true ); editor->Raise(); // Iconize( false ); @@ -1565,6 +1568,7 @@ void BOARD_EDITOR_CONTROL::setTransitions() Go( &BOARD_EDITOR_CONTROL::DrillOrigin, PCB_ACTIONS::drillOrigin.MakeEvent() ); Go( &BOARD_EDITOR_CONTROL::EditFpInFpEditor, PCB_ACTIONS::editFpInFpEditor.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::EditFpInFpEditor, PCB_ACTIONS::editLibFpInFpEditor.MakeEvent() ); // Other Go( &BOARD_EDITOR_CONTROL::ToggleLockSelected, PCB_ACTIONS::toggleLock.MakeEvent() ); diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 0718b8aa09..a2795a7254 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -234,6 +234,13 @@ TOOL_ACTION PCB_ACTIONS::editFpInFpEditor( "pcbnew.EditorControl.EditFpInFpEdito _( "Opens the selected footprint in the Footprint Editor" ), BITMAPS::module_editor ); +TOOL_ACTION PCB_ACTIONS::editLibFpInFpEditor( "pcbnew.EditorControl.EditLibFpInFpEditor", + AS_GLOBAL, + MD_CTRL + MD_SHIFT + 'E', "", + _( "Edit Library Footprint..." ), + _( "Opens the selected footprint in the Footprint Editor" ), + BITMAPS::module_editor ); + TOOL_ACTION PCB_ACTIONS::getAndPlace( "pcbnew.InteractiveEdit.FindMove", AS_GLOBAL, 'T', LEGACY_HK_NAME( "Get and Move Footprint" ), diff --git a/pcbnew/tools/pcb_actions.h b/pcbnew/tools/pcb_actions.h index 7caa91f677..d315b4a5eb 100644 --- a/pcbnew/tools/pcb_actions.h +++ b/pcbnew/tools/pcb_actions.h @@ -344,6 +344,8 @@ public: static TOOL_ACTION runDRC; static TOOL_ACTION editFpInFpEditor; + static TOOL_ACTION editLibFpInFpEditor; + static TOOL_ACTION showLayersManager; static TOOL_ACTION showPythonConsole;