Commit 39086ffb authored by Maciej Suminski's avatar Maciej Suminski

Added loading layer visibility settings when loading a board. Minor code cleaning.

parent 4e4776c3
...@@ -226,6 +226,17 @@ void PCB_BASE_FRAME::SetBoard( BOARD* aBoard ) ...@@ -226,6 +226,17 @@ void PCB_BASE_FRAME::SetBoard( BOARD* aBoard )
{ {
view->SetLayerOrder( m_galLayerOrder[i], i ); view->SetLayerOrder( m_galLayerOrder[i], i );
} }
// Load layer & elements visibility settings
for( unsigned int i = 0; i < LAYER_COUNT; ++i )
{
view->SetLayerVisible( i, m_Pcb->IsLayerVisible( i ) );
}
for( unsigned int i = 0; i < END_PCB_VISIBLE_LIST; ++i )
{
view->SetLayerVisible( ITEM_GAL_LAYER( i ), m_Pcb->IsElementVisible( i ) );
}
} }
#endif #endif
} }
......
...@@ -368,16 +368,18 @@ void PCB_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal ...@@ -368,16 +368,18 @@ void PCB_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal
{ {
KiGfx::VIEW* view = galCanvas->GetView(); KiGfx::VIEW* view = galCanvas->GetView();
view->SetLayerVisible( aLayer, isVisible ); view->SetLayerVisible( aLayer, isVisible );
if( myframe->IsGalCanvasActive() )
{
galCanvas->Refresh();
}
} }
#endif /* KICAD_GAL */ #endif /* KICAD_GAL */
if( isFinal ) if( isFinal )
{
#ifdef KICAD_GAL
if( myframe->IsGalCanvasActive() )
galCanvas->Refresh();
else
#endif /* KICAD_GAL */
myframe->GetCanvas()->Refresh(); myframe->GetCanvas()->Refresh();
}
} }
void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, EDA_COLOR_T aColor ) void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, EDA_COLOR_T aColor )
...@@ -418,14 +420,12 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) ...@@ -418,14 +420,12 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
{ {
KiGfx::VIEW* view = galCanvas->GetView(); KiGfx::VIEW* view = galCanvas->GetView();
view->SetLayerVisible( ITEM_GAL_LAYER( aId ), isEnabled ); view->SetLayerVisible( ITEM_GAL_LAYER( aId ), isEnabled );
}
if( myframe->IsGalCanvasActive() ) if( myframe->IsGalCanvasActive() )
{
galCanvas->Refresh(); galCanvas->Refresh();
} else
}
#endif /* KICAD_GAL */ #endif /* KICAD_GAL */
myframe->GetCanvas()->Refresh(); myframe->GetCanvas()->Refresh();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment