Properties: mask visibility for free text

This commit is contained in:
Jon Evans 2022-12-08 18:06:14 -05:00
parent 67df342255
commit ad33515916
1 changed files with 12 additions and 0 deletions

View File

@ -345,5 +345,17 @@ static struct PCB_TEXT_DESC
propMgr.AddProperty( new PROPERTY<PCB_TEXT, bool, BOARD_ITEM>( _HKI( "Knockout" ),
&BOARD_ITEM::SetIsKnockout, &BOARD_ITEM::IsKnockout ),
_HKI( "Text Properties" ) );
auto isFootprintText =
[]( INSPECTABLE* aItem ) -> bool
{
if( PCB_TEXT* text = dynamic_cast<PCB_TEXT*>( aItem ) )
return text->GetParentFootprint();
return false;
};
propMgr.OverrideAvailability( TYPE_HASH( PCB_TEXT ), TYPE_HASH( EDA_TEXT ),
_HKI( "Visible" ), isFootprintText );
}
} _PCB_TEXT_DESC;