From fecb53b64f06ed14e439671b9a0e1ca610abe4db Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 22 Oct 2021 21:12:57 +0100 Subject: [PATCH] Clean up removal of separate front & back footprint text visibility. Fixes https://gitlab.com/kicad/code/kicad/issues/9441 --- common/layer_id.cpp | 3 +-- common/lset.cpp | 3 +-- include/layer_ids.h | 4 ++-- pcbnew/dialogs/panel_pcbnew_color_settings.cpp | 3 +-- pcbnew/footprint.cpp | 4 ++-- pcbnew/fp_text.cpp | 5 +---- pcbnew/pcb_base_frame.cpp | 4 ++-- pcbnew/pcb_draw_panel_gal.cpp | 6 +----- pcbnew/pcbnew_printout.cpp | 5 ++--- pcbnew/tools/pcb_selection_tool.cpp | 4 ++-- pcbnew/widgets/appearance_controls.cpp | 10 +++++----- 11 files changed, 20 insertions(+), 31 deletions(-) diff --git a/common/layer_id.cpp b/common/layer_id.cpp index f8e5271885..9970df2faa 100644 --- a/common/layer_id.cpp +++ b/common/layer_id.cpp @@ -144,8 +144,7 @@ wxString LayerName( int aLayer ) case LAYER_MOD_BK: return _( "Footprints back" ); case LAYER_MOD_VALUES: return _( "Values" ); case LAYER_MOD_REFERENCES: return _( "Reference designators" ); - case LAYER_MOD_TEXT_FR: return _( "Footprint text front" ); - case LAYER_MOD_TEXT_BK: return _( "Footprint text back" ); + case LAYER_MOD_TEXT: return _( "Footprint text" ); case LAYER_MOD_TEXT_INVISIBLE: return _( "Hidden text" ); case LAYER_PAD_FR: return _( "SMD pads front" ); case LAYER_PAD_BK: return _( "SMD pads back" ); diff --git a/common/lset.cpp b/common/lset.cpp index 3d9801c4c4..c0f0de422f 100644 --- a/common/lset.cpp +++ b/common/lset.cpp @@ -938,8 +938,7 @@ GAL_SET GAL_SET::DefaultVisible() LAYER_VIA_BBLIND, LAYER_VIA_THROUGH, LAYER_NON_PLATEDHOLES, - LAYER_MOD_TEXT_FR, - LAYER_MOD_TEXT_BK, + LAYER_MOD_TEXT, // LAYER_MOD_TEXT_INVISIBLE, // Invisible text hidden by default LAYER_ANCHOR, LAYER_PAD_FR, diff --git a/include/layer_ids.h b/include/layer_ids.h index 7ab520ed5a..53703098a5 100644 --- a/include/layer_ids.h +++ b/include/layer_ids.h @@ -191,8 +191,8 @@ enum GAL_LAYER_ID: int LAYER_VIA_BBLIND = GAL_LAYER_ID_START + 2, ///< to draw blind/buried vias LAYER_VIA_THROUGH = GAL_LAYER_ID_START + 3, ///< to draw usual through hole vias LAYER_NON_PLATEDHOLES = GAL_LAYER_ID_START + 4, ///< handle color for not plated holes (holes, not pads) - LAYER_MOD_TEXT_FR = GAL_LAYER_ID_START + 5, - LAYER_MOD_TEXT_BK = GAL_LAYER_ID_START + 6, + LAYER_MOD_TEXT = GAL_LAYER_ID_START + 5, +// LAYER_MOD_TEXT_BK deprecated + 6, LAYER_MOD_TEXT_INVISIBLE = GAL_LAYER_ID_START + 7, ///< text marked as invisible LAYER_ANCHOR = GAL_LAYER_ID_START + 8, ///< anchor of items having an anchor point (texts, footprints) LAYER_PAD_FR = GAL_LAYER_ID_START + 9, ///< smd pads, front layer diff --git a/pcbnew/dialogs/panel_pcbnew_color_settings.cpp b/pcbnew/dialogs/panel_pcbnew_color_settings.cpp index 89a9d255ea..9087d29978 100644 --- a/pcbnew/dialogs/panel_pcbnew_color_settings.cpp +++ b/pcbnew/dialogs/panel_pcbnew_color_settings.cpp @@ -361,8 +361,7 @@ std::set g_excludedLayers = LAYER_MOD_VALUES, LAYER_MOD_REFERENCES, LAYER_TRACKS, - LAYER_MOD_TEXT_FR, - LAYER_MOD_TEXT_BK, + LAYER_MOD_TEXT, LAYER_PAD_PLATEDHOLES, LAYER_PAD_HOLEWALLS, LAYER_GP_OVERLAY, diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index 058628c478..25c45ac13a 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -786,11 +786,11 @@ const EDA_RECT FOOTPRINT::GetBoundingBox( bool aIncludeText, bool aIncludeInvisi // 3rd "&&" conditionals handle that. valueLayerIsVisible = board->IsLayerVisible( m_value->GetLayer() ) && board->IsElementVisible( LAYER_MOD_VALUES ) - && board->IsElementVisible( LAYER_MOD_TEXT_FR ); + && board->IsElementVisible( LAYER_MOD_TEXT ); refLayerIsVisible = board->IsLayerVisible( m_reference->GetLayer() ) && board->IsElementVisible( LAYER_MOD_REFERENCES ) - && board->IsElementVisible( LAYER_MOD_TEXT_FR ); + && board->IsElementVisible( LAYER_MOD_TEXT ); } diff --git a/pcbnew/fp_text.cpp b/pcbnew/fp_text.cpp index 82131d9919..d0998757e7 100644 --- a/pcbnew/fp_text.cpp +++ b/pcbnew/fp_text.cpp @@ -400,10 +400,7 @@ double FP_TEXT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const if( IsParentFlipped() && !aView->IsLayerVisible( LAYER_MOD_BK ) ) return HIDE; - if( IsFrontLayer( m_layer ) && !aView->IsLayerVisible( LAYER_MOD_TEXT_FR ) ) - return HIDE; - - if( IsBackLayer( m_layer ) && !aView->IsLayerVisible( LAYER_MOD_TEXT_BK ) ) + if( !aView->IsLayerVisible( LAYER_MOD_TEXT ) ) return HIDE; // Other layers are shown without any conditions diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index e2c50a0783..f322b40678 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -591,8 +591,8 @@ GENERAL_COLLECTORS_GUIDE PCB_BASE_FRAME::GetCollectorsGuide() // account for the globals guide.SetIgnoreMTextsMarkedNoShow( ! m_pcb->IsElementVisible( LAYER_MOD_TEXT_INVISIBLE ) ); - guide.SetIgnoreMTextsOnBack( ! m_pcb->IsElementVisible( LAYER_MOD_TEXT_BK ) ); - guide.SetIgnoreMTextsOnFront( ! m_pcb->IsElementVisible( LAYER_MOD_TEXT_FR ) ); + guide.SetIgnoreMTextsOnBack( ! m_pcb->IsElementVisible( LAYER_MOD_TEXT ) ); + guide.SetIgnoreMTextsOnFront( ! m_pcb->IsElementVisible( LAYER_MOD_TEXT ) ); guide.SetIgnoreModulesOnBack( ! m_pcb->IsElementVisible( LAYER_MOD_BK ) ); guide.SetIgnoreModulesOnFront( ! m_pcb->IsElementVisible( LAYER_MOD_FR ) ); guide.SetIgnorePadsOnBack( ! m_pcb->IsElementVisible( LAYER_PAD_BK ) ); diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index e1d9d44cf6..214c88c5b0 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -75,8 +75,7 @@ const LAYER_NUM GAL_LAYER_ORDER[] = User_8, ZONE_LAYER_FOR( User_8 ), User_9, ZONE_LAYER_FOR( User_9 ), - LAYER_MOD_TEXT_FR, - LAYER_MOD_REFERENCES, LAYER_MOD_VALUES, + LAYER_MOD_TEXT, LAYER_MOD_REFERENCES, LAYER_MOD_VALUES, LAYER_RATSNEST, LAYER_ANCHOR, @@ -134,7 +133,6 @@ const LAYER_NUM GAL_LAYER_ORDER[] = B_CrtYd, ZONE_LAYER_FOR( B_CrtYd ), B_Fab, ZONE_LAYER_FOR( B_Fab ), - LAYER_MOD_TEXT_BK, LAYER_DRAWINGSHEET }; @@ -607,12 +605,10 @@ void PCB_DRAW_PANEL_GAL::setDefaultLayerDeps() // Front footprints m_view->SetRequired( LAYER_PAD_FR, F_Cu ); - m_view->SetRequired( LAYER_MOD_TEXT_FR, LAYER_MOD_FR ); m_view->SetRequired( LAYER_PAD_FR_NETNAMES, LAYER_PAD_FR ); // Back footprints m_view->SetRequired( LAYER_PAD_BK, B_Cu ); - m_view->SetRequired( LAYER_MOD_TEXT_BK, LAYER_MOD_BK ); m_view->SetRequired( LAYER_PAD_BK_NETNAMES, LAYER_PAD_BK ); m_view->SetLayerTarget( LAYER_SELECT_OVERLAY, KIGFX::TARGET_OVERLAY ); diff --git a/pcbnew/pcbnew_printout.cpp b/pcbnew/pcbnew_printout.cpp index 65979db34d..945a51e091 100644 --- a/pcbnew/pcbnew_printout.cpp +++ b/pcbnew/pcbnew_printout.cpp @@ -160,8 +160,7 @@ void PCBNEW_PRINTOUT::setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet setVisibility( LAYER_MOD_BK ); setVisibility( LAYER_MOD_VALUES ); setVisibility( LAYER_MOD_REFERENCES ); - setVisibility( LAYER_MOD_TEXT_FR ); - setVisibility( LAYER_MOD_TEXT_BK ); + setVisibility( LAYER_MOD_TEXT ); setVisibility( LAYER_MOD_TEXT_INVISIBLE ); setVisibility( LAYER_PADS ); setVisibility( LAYER_PAD_FR ); @@ -209,7 +208,7 @@ void PCBNEW_PRINTOUT::setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet // be drawn on some other (technical) layers. const int alwaysEnabled[] = { - LAYER_MOD_TEXT_FR, LAYER_MOD_TEXT_BK, LAYER_MOD_FR, LAYER_MOD_BK, + LAYER_MOD_TEXT, LAYER_MOD_FR, LAYER_MOD_BK, LAYER_MOD_VALUES, LAYER_MOD_REFERENCES, LAYER_TRACKS, LAYER_ZONES, LAYER_PADS, LAYER_VIAS, LAYER_VIA_MICROVIA, LAYER_VIA_BBLIND, LAYER_PAD_FR, LAYER_PAD_BK, LAYER_PADS_TH diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index dbd0e0fe51..0ebad0ffaa 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -641,8 +641,8 @@ const GENERAL_COLLECTORS_GUIDE PCB_SELECTION_TOOL::getCollectorsGuide() const // account for the globals guide.SetIgnoreMTextsMarkedNoShow( ! board()->IsElementVisible( LAYER_MOD_TEXT_INVISIBLE ) ); - guide.SetIgnoreMTextsOnBack( ! board()->IsElementVisible( LAYER_MOD_TEXT_BK ) ); - guide.SetIgnoreMTextsOnFront( ! board()->IsElementVisible( LAYER_MOD_TEXT_FR ) ); + guide.SetIgnoreMTextsOnBack( ! board()->IsElementVisible( LAYER_MOD_TEXT ) ); + guide.SetIgnoreMTextsOnFront( ! board()->IsElementVisible( LAYER_MOD_TEXT ) ); guide.SetIgnoreModulesOnBack( ! board()->IsElementVisible( LAYER_MOD_BK ) ); guide.SetIgnoreModulesOnFront( ! board()->IsElementVisible( LAYER_MOD_FR ) ); guide.SetIgnorePadsOnBack( padsDisabled || ! board()->IsElementVisible( LAYER_PAD_BK ) ); diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index 6b352bc8b9..21b4a98a6e 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -342,7 +342,7 @@ const APPEARANCE_CONTROLS::APPEARANCE_SETTING APPEARANCE_CONTROLS::s_objectSetti RR( _( "Through-hole Pads" ),LAYER_PADS_TH, _( "Show through-hole pads" ) ), RR( _( "Values" ), LAYER_MOD_VALUES, _( "Show footprint values" ) ), RR( _( "References" ), LAYER_MOD_REFERENCES, _( "Show footprint references" ) ), - RR( _( "Footprint Text" ), LAYER_MOD_TEXT_FR, _( "Show all footprint text" ) ), + RR( _( "Footprint Text" ), LAYER_MOD_TEXT, _( "Show all footprint text" ) ), RR( _( "Hidden Text" ), LAYER_MOD_TEXT_INVISIBLE, _( "Show footprint text marked as invisible" ) ), RR(), RR(), @@ -366,7 +366,7 @@ static std::set s_allowedInFpEditor = LAYER_PADS_TH, LAYER_MOD_VALUES, LAYER_MOD_REFERENCES, - LAYER_MOD_TEXT_FR, + LAYER_MOD_TEXT, LAYER_MOD_TEXT_INVISIBLE, LAYER_GRID }; @@ -1937,7 +1937,7 @@ void APPEARANCE_CONTROLS::onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool i syncLayerPresetSelection(); break; - case LAYER_MOD_TEXT_FR: + case LAYER_MOD_TEXT: // Because Footprint Text is a meta-control that also can disable values/references, // drag them along here so that the user is less likely to be confused. if( isFinal ) @@ -1957,8 +1957,8 @@ void APPEARANCE_CONTROLS::onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool i // meta-control is disabled, we should put it back on. if( isVisible ) { - onObjectVisibilityChanged( LAYER_MOD_TEXT_FR, isVisible, false ); - m_objectSettingsMap[LAYER_MOD_TEXT_FR]->ctl_visibility->SetValue( isVisible ); + onObjectVisibilityChanged( LAYER_MOD_TEXT, isVisible, false ); + m_objectSettingsMap[LAYER_MOD_TEXT]->ctl_visibility->SetValue( isVisible ); } break;