Gerbview: Don't show unused layers
This commit is contained in:
parent
3338745637
commit
3c1a6e95d8
|
@ -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
|
||||||
|
|
|
@ -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 ) );
|
||||||
|
|
|
@ -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 ) );
|
||||||
|
|
Loading…
Reference in New Issue