diff --git a/pcbnew/tools/board_inspection_tool.cpp b/pcbnew/tools/board_inspection_tool.cpp index 39a8821b74..11e30273f5 100644 --- a/pcbnew/tools/board_inspection_tool.cpp +++ b/pcbnew/tools/board_inspection_tool.cpp @@ -1242,7 +1242,7 @@ void BOARD_INSPECTION_TOOL::doHideNet( int aNetCode, bool aHide ) m_frame->GetCanvas()->RedrawRatsnest(); m_frame->GetCanvas()->Refresh(); - m_frame->GetAppearancePanel()->OnBoardNetSettingsChanged( *m_frame->GetBoard() ); + m_frame->GetAppearancePanel()->OnNetVisibilityChanged( aNetCode, !aHide ); } diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index cfd170009c..40c8f15456 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -948,6 +948,18 @@ void APPEARANCE_CONTROLS::OnBoardNetSettingsChanged( BOARD& aBoard ) } +void APPEARANCE_CONTROLS::OnNetVisibilityChanged( int aNetCode, bool aVisibility ) +{ + int row = m_netsTable->GetRowByNetcode( aNetCode ); + + if( row >= 0 ) + { + m_netsTable->SetValueAsBool( row, NET_GRID_TABLE::COL_VISIBILITY, aVisibility ); + m_netsGrid->ForceRefresh(); + } +} + + bool APPEARANCE_CONTROLS::doesBoardItemNeedRebuild( BOARD_ITEM* aBoardItem ) { return aBoardItem->Type() == PCB_NETINFO_T; diff --git a/pcbnew/widgets/appearance_controls.h b/pcbnew/widgets/appearance_controls.h index 0c4ee23002..fabaf8ec8c 100644 --- a/pcbnew/widgets/appearance_controls.h +++ b/pcbnew/widgets/appearance_controls.h @@ -224,6 +224,9 @@ public: ///< Update the widget when the active board layer is changed. void OnLayerChanged(); + /// Notifies the panel when a net has been hidden or shown via the external tool. + void OnNetVisibilityChanged( int aNetCode, bool aVisibility ); + ///< Manually update visibility for a given layer void SetLayerVisible( LAYER_NUM aLayer, bool isVisible );