diff --git a/common/widgets/properties_panel.cpp b/common/widgets/properties_panel.cpp index f98c4f86cc..054c316c2d 100644 --- a/common/widgets/properties_panel.cpp +++ b/common/widgets/properties_panel.cpp @@ -325,3 +325,10 @@ void PROPERTIES_PANEL::RecalculateSplitterPos() else m_grid->SetSplitterPosition( m_splitter_key_proportion * m_grid->GetSize().x ); } + + +void PROPERTIES_PANEL::SetSplitterProportion( float aProportion ) +{ + m_splitter_key_proportion = aProportion; + RecalculateSplitterPos(); +} \ No newline at end of file diff --git a/common/widgets/properties_panel.h b/common/widgets/properties_panel.h index 049fed0c38..4741a7c6d8 100644 --- a/common/widgets/properties_panel.h +++ b/common/widgets/properties_panel.h @@ -62,6 +62,9 @@ public: void RecalculateSplitterPos(); + void SetSplitterProportion( float aProportion ); + float SplitterProportion() const { return m_splitter_key_proportion; } + protected: virtual void update( const SELECTION& aSelection ); virtual wxPGProperty* createPGProperty( const PROPERTY_BASE* aProperty ) const = 0; diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index ab64485c8a..7621bb5ed2 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -246,8 +246,13 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : ReCreateOptToolbar(); if( ADVANCED_CFG::GetCfg().m_ShowPropertiesPanel ) + { 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_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.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) diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index c5f4a1d0a7..80479833c1 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -97,6 +97,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_params.emplace_back( new PARAM( "aui.properties_panel_width", &m_AuiPanels.properties_panel_width, -1 ) ); + m_params.emplace_back( new PARAM( "aui.properties_splitter_proportion", + &m_AuiPanels.properties_splitter_proportion, 0.5f ) ); + m_params.emplace_back( new PARAM( "aui.search_panel_height", &m_AuiPanels.search_panel_height, -1 ) ); diff --git a/pcbnew/pcbnew_settings.h b/pcbnew/pcbnew_settings.h index 9b7dfbad18..a1d92160b2 100644 --- a/pcbnew/pcbnew_settings.h +++ b/pcbnew/pcbnew_settings.h @@ -137,6 +137,7 @@ public: bool appearance_expand_net_display; int right_panel_width; int properties_panel_width; + float properties_splitter_proportion; int search_panel_height; bool show_layer_manager; bool show_properties;