diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 1d6c89f049..82f94f055f 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -335,6 +335,19 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : SetAuiPaneSize( m_auimgr, layersManager, settings->m_AuiPanels.right_panel_width, -1 ); } + if( settings->m_AuiPanels.properties_panel_width > 0 && m_propertiesPanel ) + { + wxAuiPaneInfo& propertiesPanel = m_auimgr.GetPane( "PropertiesManager" ); + SetAuiPaneSize( m_auimgr, propertiesPanel, + settings->m_AuiPanels.properties_panel_width, -1 ); + } + + if( settings->m_AuiPanels.search_panel_height > 0 ) + { + wxAuiPaneInfo& searchPane = m_auimgr.GetPane( SearchPaneName() ); + SetAuiPaneSize( m_auimgr, searchPane, -1, settings->m_AuiPanels.search_panel_height ); + } + m_appearancePanel->SetTabIndex( settings->m_AuiPanels.appearance_panel_tab ); } @@ -1198,11 +1211,17 @@ void PCB_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg ) cfg->m_AuiPanels.show_layer_manager = m_show_layer_manager_tools; cfg->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x; cfg->m_AuiPanels.appearance_panel_tab = m_appearancePanel->GetTabIndex(); - cfg->m_AuiPanels.show_properties = m_show_properties; + + if( m_propertiesPanel ) + { + cfg->m_AuiPanels.show_properties = m_show_properties; + cfg->m_AuiPanels.properties_panel_width = m_propertiesPanel->GetSize().x; + } // ensure m_show_search is up to date (the pane can be closed) m_show_search = m_auimgr.GetPane( SearchPaneName() ).IsShown(); cfg->m_AuiPanels.show_search = m_show_search; + cfg->m_AuiPanels.search_panel_height = m_searchPane->GetSize().y; } } diff --git a/pcbnew/pcb_track.cpp b/pcbnew/pcb_track.cpp index da58d328df..52ded06aa2 100644 --- a/pcbnew/pcb_track.cpp +++ b/pcbnew/pcb_track.cpp @@ -1240,11 +1240,11 @@ static struct TRACK_VIA_DESC propMgr.AddProperty( new PROPERTY( _HKI( "Width" ), &PCB_TRACK::SetWidth, &PCB_TRACK::GetWidth, PROPERTY_DISPLAY::PT_SIZE ) ); propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Position X" ), - new PROPERTY( _HKI( "Origin X" ), + new PROPERTY( _HKI( "Start X" ), &PCB_TRACK::SetX, &PCB_TRACK::GetX, PROPERTY_DISPLAY::PT_COORD, ORIGIN_TRANSFORMS::ABS_X_COORD) ); propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Position Y" ), - new PROPERTY( _HKI( "Origin Y" ), + new PROPERTY( _HKI( "Start Y" ), &PCB_TRACK::SetY, &PCB_TRACK::GetY, PROPERTY_DISPLAY::PT_COORD, ORIGIN_TRANSFORMS::ABS_Y_COORD ) ); propMgr.AddProperty( new PROPERTY( _HKI( "End X" ), @@ -1261,11 +1261,11 @@ static struct TRACK_VIA_DESC propMgr.AddProperty( new PROPERTY( _HKI( "Width" ), &PCB_ARC::SetWidth, &PCB_ARC::GetWidth, PROPERTY_DISPLAY::PT_SIZE ) ); propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Position X" ), - new PROPERTY( _HKI( "Origin X" ), + new PROPERTY( _HKI( "Start X" ), &PCB_TRACK::SetX, &PCB_ARC::GetX, PROPERTY_DISPLAY::PT_COORD, ORIGIN_TRANSFORMS::ABS_X_COORD) ); propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Position Y" ), - new PROPERTY( _HKI( "Origin Y" ), + new PROPERTY( _HKI( "Start Y" ), &PCB_TRACK::SetY, &PCB_ARC::GetY, PROPERTY_DISPLAY::PT_COORD, ORIGIN_TRANSFORMS::ABS_Y_COORD) ); propMgr.AddProperty( new PROPERTY( _HKI( "End X" ), diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 8ba4c09669..c06373fa8f 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -93,6 +93,12 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_params.emplace_back( new PARAM( "aui.right_panel_width", &m_AuiPanels.right_panel_width, -1 ) ); + m_params.emplace_back( new PARAM( "aui.properties_panel_width", + &m_AuiPanels.properties_panel_width, -1 ) ); + + m_params.emplace_back( new PARAM( "aui.search_panel_height", + &m_AuiPanels.search_panel_height, -1 ) ); + m_params.emplace_back( new PARAM( "aui.appearance_panel_tab", &m_AuiPanels.appearance_panel_tab, 0, 0, 2 ) ); diff --git a/pcbnew/pcbnew_settings.h b/pcbnew/pcbnew_settings.h index de6b575493..8960bb411e 100644 --- a/pcbnew/pcbnew_settings.h +++ b/pcbnew/pcbnew_settings.h @@ -127,6 +127,8 @@ public: bool appearance_expand_layer_display; bool appearance_expand_net_display; int right_panel_width; + int properties_panel_width; + int search_panel_height; bool show_layer_manager; bool show_properties; bool show_search; diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index 3e33244016..33ddb7690f 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -789,27 +790,51 @@ void PCB_EDIT_FRAME::ToggleLayersManager() void PCB_EDIT_FRAME::ToggleProperties() { + if( !m_propertiesPanel ) + return; + + PCBNEW_SETTINGS* settings = GetPcbNewSettings(); + m_show_properties = !m_show_properties; - m_auimgr.GetPane( "PropertiesManager" ).Show( m_show_properties ); - m_auimgr.Update(); + wxAuiPaneInfo& propertiesPaneInfo = m_auimgr.GetPane( "PropertiesManager" ); + propertiesPaneInfo.Show( m_show_properties ); + + if( m_show_properties ) + { + SetAuiPaneSize( m_auimgr, propertiesPaneInfo, + settings->m_AuiPanels.properties_panel_width, -1 ); + } + else + { + settings->m_AuiPanels.properties_panel_width = m_propertiesPanel->GetSize().x; + m_auimgr.Update(); + } } void PCB_EDIT_FRAME::ToggleSearch() { + PCBNEW_SETTINGS* settings = GetPcbNewSettings(); + // Ensure m_show_search is up to date (the pane can be closed outside the menu) m_show_search = m_auimgr.GetPane( SearchPaneName() ).IsShown(); m_show_search = !m_show_search; - m_auimgr.GetPane( SearchPaneName() ).Show( m_show_search ); - m_auimgr.Update(); + wxAuiPaneInfo& searchPaneInfo = m_auimgr.GetPane( SearchPaneName() ); + searchPaneInfo.Show( m_show_search ); if( m_show_search ) { + SetAuiPaneSize( m_auimgr, searchPaneInfo, -1, settings->m_AuiPanels.search_panel_height ); m_searchPane->FocusSearch(); } + else + { + settings->m_AuiPanels.search_panel_height = m_searchPane->GetSize().y; + m_auimgr.Update(); + } } diff --git a/pcbnew/tools/board_editor_control.cpp b/pcbnew/tools/board_editor_control.cpp index 11471aa8e0..f5097d498f 100644 --- a/pcbnew/tools/board_editor_control.cpp +++ b/pcbnew/tools/board_editor_control.cpp @@ -1667,8 +1667,8 @@ void BOARD_EDITOR_CONTROL::setTransitions() ACTIONS::updateSchematicFromPcb.MakeEvent() ); Go( &BOARD_EDITOR_CONTROL::ShowEeschema, PCB_ACTIONS::showEeschema.MakeEvent() ); Go( &BOARD_EDITOR_CONTROL::ToggleLayersManager, PCB_ACTIONS::showLayersManager.MakeEvent() ); - Go( &BOARD_EDITOR_CONTROL::ToggleProperties, PCB_ACTIONS::showProperties.MakeEvent() ); - Go( &BOARD_EDITOR_CONTROL::ToggleSearch, PCB_ACTIONS::showSearch.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ToggleProperties, PCB_ACTIONS::showProperties.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ToggleSearch, PCB_ACTIONS::showSearch.MakeEvent() ); Go( &BOARD_EDITOR_CONTROL::TogglePythonConsole, PCB_ACTIONS::showPythonConsole.MakeEvent() ); Go( &BOARD_EDITOR_CONTROL::RepairBoard, PCB_ACTIONS::repairBoard.MakeEvent() ); }