diff --git a/common/lset.cpp b/common/lset.cpp index f7c6d3fe44..f95acc0671 100644 --- a/common/lset.cpp +++ b/common/lset.cpp @@ -783,6 +783,13 @@ LSET LSET::BackMask() } +LSET LSET::ForbiddenFootprintLayers() +{ + static const LSET saved = InternalCuMask().set( Edge_Cuts ).set( Margin ); + return saved; +} + + LSET LSET::ForbiddenTextLayers() { static const LSET saved( 2, Edge_Cuts, Margin ); diff --git a/include/layers_id_colors_and_visibility.h b/include/layers_id_colors_and_visibility.h index 1a08615fa6..e75cd410e8 100644 --- a/include/layers_id_colors_and_visibility.h +++ b/include/layers_id_colors_and_visibility.h @@ -523,6 +523,18 @@ public: static LSET UserMask(); + /** + * Function ForbiddenFootprintLayers + * Layers which are not allowed within footprint definitions. Currently internal + * copper layers, Edge.Cuts and Margin. + */ + + static LSET ForbiddenFootprintLayers(); + + /** + * Function ForbiddenTextLayers + * Layers which are now allowed to have text on them. Currently Edge.Cuts and Margin. + */ static LSET ForbiddenTextLayers(); /** diff --git a/pcbnew/pcb_layer_widget.cpp b/pcbnew/pcb_layer_widget.cpp index 766b21a958..2a179dbc5b 100644 --- a/pcbnew/pcb_layer_widget.cpp +++ b/pcbnew/pcb_layer_widget.cpp @@ -156,9 +156,7 @@ bool PCB_LAYER_WIDGET::isAllowedInFpMode( int aId ) bool PCB_LAYER_WIDGET::isLayerAllowedInFpMode( PCB_LAYER_ID aLayer ) { static LSET allowed = LSET::AllTechMask(); - // Currently not in use because putting a graphic item on a copper layer - // is not currently supported by DRC. - // allowed.set( F_Cu ).set( B_Cu ); + allowed.set( F_Cu ).set( B_Cu ); return allowed.test( aLayer ); } @@ -519,11 +517,10 @@ void PCB_LAYER_WIDGET::ReFill() brd->GetLayerName( layer ), layer, myframe->Settings().Colors().GetLayerColor( layer ), dsc, true ) ); - if( m_fp_editor_mode && !isLayerAllowedInFpMode( layer ) ) + if( m_fp_editor_mode && LSET::ForbiddenFootprintLayers().test( layer ) ) { getLayerComp( GetLayerRowCount()-1, COLUMN_COLOR_LYRNAME )->Enable( false ); - getLayerComp( GetLayerRowCount()-1, - COLUMN_COLORBM )->SetToolTip( wxEmptyString ); + getLayerComp( GetLayerRowCount()-1, COLUMN_COLORBM )->SetToolTip( wxEmptyString ); } } @@ -568,11 +565,10 @@ void PCB_LAYER_WIDGET::ReFill() brd->GetLayerName( layer ), layer, myframe->Settings().Colors().GetLayerColor( layer ), wxGetTranslation( non_cu_seq[i].tooltip ), true ) ); - if( m_fp_editor_mode && !isLayerAllowedInFpMode( layer ) ) + if( m_fp_editor_mode && LSET::ForbiddenFootprintLayers().test( layer ) ) { getLayerComp( GetLayerRowCount()-1, COLUMN_COLOR_LYRNAME )->Enable( false ); - getLayerComp( GetLayerRowCount()-1, - COLUMN_COLORBM )->SetToolTip( wxEmptyString ); + getLayerComp( GetLayerRowCount()-1, COLUMN_COLORBM )->SetToolTip( wxEmptyString ); } } } @@ -616,7 +612,7 @@ bool PCB_LAYER_WIDGET::OnLayerSelect( int aLayer ) // false from this function. PCB_LAYER_ID layer = ToLAYER_ID( aLayer ); - if( m_fp_editor_mode && !isLayerAllowedInFpMode( layer ) ) + if( m_fp_editor_mode && LSET::ForbiddenFootprintLayers().test( layer ) ) return false; myframe->SetActiveLayer( layer );