Properties: save and restore splitter position
This commit is contained in:
parent
5251ea6f27
commit
33d76f63b0
|
@ -325,3 +325,10 @@ void PROPERTIES_PANEL::RecalculateSplitterPos()
|
||||||
else
|
else
|
||||||
m_grid->SetSplitterPosition( m_splitter_key_proportion * m_grid->GetSize().x );
|
m_grid->SetSplitterPosition( m_splitter_key_proportion * m_grid->GetSize().x );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PROPERTIES_PANEL::SetSplitterProportion( float aProportion )
|
||||||
|
{
|
||||||
|
m_splitter_key_proportion = aProportion;
|
||||||
|
RecalculateSplitterPos();
|
||||||
|
}
|
|
@ -62,6 +62,9 @@ public:
|
||||||
|
|
||||||
void RecalculateSplitterPos();
|
void RecalculateSplitterPos();
|
||||||
|
|
||||||
|
void SetSplitterProportion( float aProportion );
|
||||||
|
float SplitterProportion() const { return m_splitter_key_proportion; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void update( const SELECTION& aSelection );
|
virtual void update( const SELECTION& aSelection );
|
||||||
virtual wxPGProperty* createPGProperty( const PROPERTY_BASE* aProperty ) const = 0;
|
virtual wxPGProperty* createPGProperty( const PROPERTY_BASE* aProperty ) const = 0;
|
||||||
|
|
|
@ -246,8 +246,13 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
ReCreateOptToolbar();
|
ReCreateOptToolbar();
|
||||||
|
|
||||||
if( ADVANCED_CFG::GetCfg().m_ShowPropertiesPanel )
|
if( ADVANCED_CFG::GetCfg().m_ShowPropertiesPanel )
|
||||||
|
{
|
||||||
m_propertiesPanel = new PCB_PROPERTIES_PANEL( this, this );
|
m_propertiesPanel = new PCB_PROPERTIES_PANEL( this, this );
|
||||||
|
|
||||||
|
float proportion = GetPcbNewSettings()->m_AuiPanels.properties_splitter_proportion;
|
||||||
|
m_propertiesPanel->SetSplitterProportion( proportion );
|
||||||
|
}
|
||||||
|
|
||||||
m_selectionFilterPanel = new PANEL_SELECTION_FILTER( this );
|
m_selectionFilterPanel = new PANEL_SELECTION_FILTER( this );
|
||||||
|
|
||||||
m_appearancePanel = new APPEARANCE_CONTROLS( this, GetCanvas() );
|
m_appearancePanel = new APPEARANCE_CONTROLS( this, GetCanvas() );
|
||||||
|
@ -1240,6 +1245,9 @@ void PCB_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
{
|
{
|
||||||
cfg->m_AuiPanels.show_properties = m_show_properties;
|
cfg->m_AuiPanels.show_properties = m_show_properties;
|
||||||
cfg->m_AuiPanels.properties_panel_width = m_propertiesPanel->GetSize().x;
|
cfg->m_AuiPanels.properties_panel_width = m_propertiesPanel->GetSize().x;
|
||||||
|
|
||||||
|
cfg->m_AuiPanels.properties_splitter_proportion =
|
||||||
|
m_propertiesPanel->SplitterProportion();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure m_show_search is up to date (the pane can be closed)
|
// ensure m_show_search is up to date (the pane can be closed)
|
||||||
|
|
|
@ -97,6 +97,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
|
||||||
m_params.emplace_back( new PARAM<int>( "aui.properties_panel_width",
|
m_params.emplace_back( new PARAM<int>( "aui.properties_panel_width",
|
||||||
&m_AuiPanels.properties_panel_width, -1 ) );
|
&m_AuiPanels.properties_panel_width, -1 ) );
|
||||||
|
|
||||||
|
m_params.emplace_back( new PARAM<float>( "aui.properties_splitter_proportion",
|
||||||
|
&m_AuiPanels.properties_splitter_proportion, 0.5f ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<int>( "aui.search_panel_height",
|
m_params.emplace_back( new PARAM<int>( "aui.search_panel_height",
|
||||||
&m_AuiPanels.search_panel_height, -1 ) );
|
&m_AuiPanels.search_panel_height, -1 ) );
|
||||||
|
|
||||||
|
|
|
@ -137,6 +137,7 @@ public:
|
||||||
bool appearance_expand_net_display;
|
bool appearance_expand_net_display;
|
||||||
int right_panel_width;
|
int right_panel_width;
|
||||||
int properties_panel_width;
|
int properties_panel_width;
|
||||||
|
float properties_splitter_proportion;
|
||||||
int search_panel_height;
|
int search_panel_height;
|
||||||
bool show_layer_manager;
|
bool show_layer_manager;
|
||||||
bool show_properties;
|
bool show_properties;
|
||||||
|
|
Loading…
Reference in New Issue