Schematic: show update/change symbols for multiple symbol selection

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13231
This commit is contained in:
Mike Williams 2022-12-22 14:00:10 -05:00
parent eceee28c99
commit 8b7d0d71fb
3 changed files with 9 additions and 0 deletions

View File

@ -119,6 +119,12 @@ SELECTION_CONDITION EE_CONDITIONS::SingleNonExcludedMarker = []( const SELECTION
};
SELECTION_CONDITION EE_CONDITIONS::MultipleSymbolsOrPower = []( const SELECTION& aSel )
{
return aSel.GetSize() > 1 && aSel.OnlyContains( { SCH_SYMBOL_T } );
};
#define HITTEST_THRESHOLD_PIXELS 5

View File

@ -51,6 +51,7 @@ public:
static SELECTION_CONDITION SingleDeMorganSymbol;
static SELECTION_CONDITION SingleMultiUnitSymbol;
static SELECTION_CONDITION SingleNonExcludedMarker;
static SELECTION_CONDITION MultipleSymbolsOrPower;
};

View File

@ -477,6 +477,8 @@ bool SCH_EDIT_TOOL::Init()
selToolMenu.AddItem( EE_ACTIONS::editWithLibEdit, E_C::SingleSymbolOrPower && E_C::Idle, 200 );
selToolMenu.AddItem( EE_ACTIONS::changeSymbol, E_C::SingleSymbolOrPower, 200 );
selToolMenu.AddItem( EE_ACTIONS::updateSymbol, E_C::SingleSymbolOrPower, 200 );
selToolMenu.AddItem( EE_ACTIONS::changeSymbols, E_C::MultipleSymbolsOrPower, 200 );
selToolMenu.AddItem( EE_ACTIONS::updateSymbols, E_C::MultipleSymbolsOrPower, 200 );
CONDITIONAL_MENU* convertToSubMenu = new CONDITIONAL_MENU( m_selectionTool );
convertToSubMenu->SetTitle( _( "Change To" ) );