Hide text items which are required on a single-item delete.

Fixes https://gitlab.com/kicad/code/kicad/issues/9973
This commit is contained in:
Jeff Young 2022-01-22 16:11:46 +00:00
parent 22ff66f142
commit f8d6bf4cc9
1 changed files with 20 additions and 0 deletions

View File

@ -1825,6 +1825,26 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
getView()->Remove( text );
parent->Remove( text );
}
else if( selectionCopy.GetSize() == 1 )
{
text->SetVisible( false );
getView()->Update( text );
switch( text->GetType() )
{
case FP_TEXT::TEXT_is_REFERENCE:
frame()->ShowInfoBarMsg( _( "Reference designator hidden (it is required and "
"can not be deleted)." ) );
break;
case FP_TEXT::TEXT_is_VALUE:
frame()->ShowInfoBarMsg( _( "Value hidden (it is required and can not be "
"deleted)." ) );
break;
default:
wxFAIL; // Shouldn't get here
break;
}
}
break;
}