Gerbview: Don't show unused layers

This commit is contained in:
Mike Williams 2021-08-04 13:44:26 -04:00
parent 3338745637
commit 3c1a6e95d8
3 changed files with 11 additions and 1 deletions

View File

@ -582,7 +582,7 @@ void GERBVIEW_FRAME::UpdateTitleAndInfo()
SetStatusText( wxEmptyString, 0 ); SetStatusText( wxEmptyString, 0 );
wxString info; wxString info;
info.Printf( _( "Drawing layer %d not in use" ), GetActiveLayer() + 1 ); info.Printf( _( "Drawing layer not in use" ) );
m_TextInfo->SetValue( info ); m_TextInfo->SetValue( info );
if( KIUI::EnsureTextCtrlWidth( m_TextInfo, &info ) ) // Resized if( KIUI::EnsureTextCtrlWidth( m_TextInfo, &info ) ) // Resized

View File

@ -41,6 +41,10 @@ void GBR_LAYER_BOX_SELECTOR::Resync()
if( !isLayerEnabled( layerid ) ) if( !isLayerEnabled( layerid ) )
continue; continue;
// Don't show unused layers
if ( images.GetGbrImage(layerid) == nullptr )
continue;
// Prepare Bitmap // Prepare Bitmap
wxBitmap bmp( BM_SIZE, BM_SIZE ); wxBitmap bmp( BM_SIZE, BM_SIZE );
DrawColorSwatch( bmp, getLayerColor( LAYER_PCB_BACKGROUND ), getLayerColor( layerid ) ); DrawColorSwatch( bmp, getLayerColor( LAYER_PCB_BACKGROUND ), getLayerColor( layerid ) );

View File

@ -218,10 +218,16 @@ bool GERBER_LAYER_WIDGET::OnLayerSelected()
void GERBER_LAYER_WIDGET::ReFill() void GERBER_LAYER_WIDGET::ReFill()
{ {
ClearLayerRows();
Freeze(); Freeze();
for( int layer = 0; layer < GERBER_DRAWLAYERS_COUNT; ++layer ) for( int layer = 0; layer < GERBER_DRAWLAYERS_COUNT; ++layer )
{ {
// Don't show inactive layers
if ( GetImagesList()->GetGbrImage(layer) == nullptr )
continue;
int aRow = findLayerRow( layer ); int aRow = findLayerRow( layer );
bool visible = true; bool visible = true;
COLOR4D color = m_frame->GetLayerColor( GERBER_DRAW_LAYER( layer ) ); COLOR4D color = m_frame->GetLayerColor( GERBER_DRAW_LAYER( layer ) );