Disable ungroup where there are no groups in the selection.
Fixes https://gitlab.com/kicad/code/kicad/issues/9182
This commit is contained in:
parent
4b3490a2b9
commit
34c2bd58d1
|
@ -1024,11 +1024,23 @@ void FOOTPRINT_EDIT_FRAME::setupUIConditions()
|
|||
mgr->SetConditions( ACTIONS::duplicate, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( ACTIONS::selectAll, ENABLE( cond.HasItems() ) );
|
||||
|
||||
auto haveAtLeastOneGroupCond =
|
||||
[]( const SELECTION& aSel )
|
||||
{
|
||||
for( EDA_ITEM* item : aSel )
|
||||
{
|
||||
if( item->Type() == PCB_GROUP_T )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
mgr->SetConditions( PCB_ACTIONS::rotateCw, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::rotateCcw, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::mirror, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::group, ENABLE( SELECTION_CONDITIONS::MoreThan( 1 ) ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::ungroup, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::ungroup, ENABLE( haveAtLeastOneGroupCond ) );
|
||||
|
||||
mgr->SetConditions( PCB_ACTIONS::padDisplayMode, CHECK( !cond.PadFillDisplay() ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::textOutlines, CHECK( !cond.TextFillDisplay() ) );
|
||||
|
|
|
@ -532,10 +532,22 @@ void PCB_EDIT_FRAME::setupUIConditions()
|
|||
mgr->SetConditions( ACTIONS::doDelete, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( ACTIONS::duplicate, ENABLE( cond.HasItems() ) );
|
||||
|
||||
auto haveAtLeastOneGroupCond =
|
||||
[]( const SELECTION& aSel )
|
||||
{
|
||||
for( EDA_ITEM* item : aSel )
|
||||
{
|
||||
if( item->Type() == PCB_GROUP_T )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
mgr->SetConditions( PCB_ACTIONS::rotateCw, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::rotateCcw, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::group, ENABLE( SELECTION_CONDITIONS::MoreThan( 1 ) ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::ungroup, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::ungroup, ENABLE( haveAtLeastOneGroupCond ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::lock, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::unlock, ENABLE( cond.HasItems() ) );
|
||||
|
||||
|
|
Loading…
Reference in New Issue