Fix value field visibility issues when importing Eagle schematics.
Eagle schematics do not show the value field when it's not defined or when not package (footprint) is defined for the symbol which is the case for power symbols. Don't show the value field in KiCad to bring the view more in line with what Eagle displays. Inspired by Stefan's merge request #13433. Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13433
This commit is contained in:
parent
c43050b91b
commit
4c5203fabf
|
@ -1491,10 +1491,15 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
|
||||||
|
|
||||||
symbol->GetField( VALUE_FIELD )->SetText( value );
|
symbol->GetField( VALUE_FIELD )->SetText( value );
|
||||||
|
|
||||||
|
// Hide the value field if the Eagle "package" element is empty which is the case for most
|
||||||
|
// power symbols which Eagle hides by default or no Eagle "value" element is defined.
|
||||||
|
bool showValueField = !( package.IsEmpty() || !epart->value ||
|
||||||
|
!part->GetFieldById( VALUE_FIELD )->IsVisible() );
|
||||||
|
|
||||||
// Set the visibility of fields.
|
// Set the visibility of fields.
|
||||||
symbol->GetField( REFERENCE_FIELD )->SetVisible(
|
symbol->GetField( REFERENCE_FIELD )->SetVisible(
|
||||||
part->GetFieldById( REFERENCE_FIELD )->IsVisible() );
|
part->GetFieldById( REFERENCE_FIELD )->IsVisible() );
|
||||||
symbol->GetField( VALUE_FIELD )->SetVisible( part->GetFieldById( VALUE_FIELD )->IsVisible() );
|
symbol->GetField( VALUE_FIELD )->SetVisible( showValueField );
|
||||||
|
|
||||||
for( const auto& a : epart->attribute )
|
for( const auto& a : epart->attribute )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue