Save flip board status in custom preset
This commit is contained in:
parent
a63025733a
commit
2d54bc42cb
|
@ -136,6 +136,7 @@ struct LAYER_PRESET
|
||||||
layers = LSET::AllLayersMask();
|
layers = LSET::AllLayersMask();
|
||||||
renderLayers = GAL_SET::DefaultVisible();
|
renderLayers = GAL_SET::DefaultVisible();
|
||||||
readOnly = false;
|
readOnly = false;
|
||||||
|
flipBoard = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LAYER_PRESET( const wxString& aName, const LSET& aVisibleLayers ) :
|
LAYER_PRESET( const wxString& aName, const LSET& aVisibleLayers ) :
|
||||||
|
@ -145,6 +146,7 @@ struct LAYER_PRESET
|
||||||
{
|
{
|
||||||
renderLayers = GAL_SET::DefaultVisible();
|
renderLayers = GAL_SET::DefaultVisible();
|
||||||
readOnly = false;
|
readOnly = false;
|
||||||
|
flipBoard = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LAYER_PRESET( const wxString& aName, const LSET& aVisibleLayers, const GAL_SET& aVisibleObjects,
|
LAYER_PRESET( const wxString& aName, const LSET& aVisibleLayers, const GAL_SET& aVisibleObjects,
|
||||||
|
@ -155,6 +157,7 @@ struct LAYER_PRESET
|
||||||
activeLayer( aActiveLayer )
|
activeLayer( aActiveLayer )
|
||||||
{
|
{
|
||||||
readOnly = false;
|
readOnly = false;
|
||||||
|
flipBoard = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LayersMatch( const LAYER_PRESET& aOther )
|
bool LayersMatch( const LAYER_PRESET& aOther )
|
||||||
|
@ -165,6 +168,7 @@ struct LAYER_PRESET
|
||||||
wxString name; ///< A name for this layer set
|
wxString name; ///< A name for this layer set
|
||||||
LSET layers; ///< Board layers that are visible
|
LSET layers; ///< Board layers that are visible
|
||||||
GAL_SET renderLayers; ///< Render layers (e.g. object types) that are visible
|
GAL_SET renderLayers; ///< Render layers (e.g. object types) that are visible
|
||||||
|
bool flipBoard; ///< True if the flip board is enabled
|
||||||
PCB_LAYER_ID activeLayer; ///< Optional layer to set active when this preset is loaded
|
PCB_LAYER_ID activeLayer; ///< Optional layer to set active when this preset is loaded
|
||||||
bool readOnly; ///< True if this is a read-only (built-in) preset
|
bool readOnly; ///< True if this is a read-only (built-in) preset
|
||||||
};
|
};
|
||||||
|
|
|
@ -2645,11 +2645,13 @@ void APPEARANCE_CONTROLS::onLayerPresetChanged( wxCommandEvent& aEvent )
|
||||||
if( !exists )
|
if( !exists )
|
||||||
{
|
{
|
||||||
index = m_cbLayerPresets->Insert( name, index - 1, static_cast<void*>( preset ) );
|
index = m_cbLayerPresets->Insert( name, index - 1, static_cast<void*>( preset ) );
|
||||||
|
preset->flipBoard = m_cbFlipBoard->GetValue();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
preset->layers = getVisibleLayers();
|
preset->layers = getVisibleLayers();
|
||||||
preset->renderLayers = getVisibleObjects();
|
preset->renderLayers = getVisibleObjects();
|
||||||
|
preset->flipBoard = m_cbFlipBoard->GetValue();
|
||||||
|
|
||||||
index = m_cbLayerPresets->FindString( name );
|
index = m_cbLayerPresets->FindString( name );
|
||||||
m_presetMRU.Remove( name );
|
m_presetMRU.Remove( name );
|
||||||
|
@ -2761,6 +2763,12 @@ void APPEARANCE_CONTROLS::doApplyLayerPreset( const LAYER_PRESET& aPreset )
|
||||||
if( !m_isFpEditor )
|
if( !m_isFpEditor )
|
||||||
m_frame->GetCanvas()->SyncLayersVisibility( board );
|
m_frame->GetCanvas()->SyncLayersVisibility( board );
|
||||||
|
|
||||||
|
if( aPreset.flipBoard )
|
||||||
|
{
|
||||||
|
m_frame->GetCanvas()->GetView()->SetMirror( true, false );
|
||||||
|
m_frame->GetCanvas()->GetView()->RecacheAllItems();
|
||||||
|
}
|
||||||
|
|
||||||
m_frame->GetCanvas()->Refresh();
|
m_frame->GetCanvas()->Refresh();
|
||||||
|
|
||||||
syncColorsAndVisibility();
|
syncColorsAndVisibility();
|
||||||
|
|
Loading…
Reference in New Issue