diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index b33a6d144c..5217dc9085 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -162,6 +162,45 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) : m_auimgr.Update(); m_initialized = true; + if( CVPCB_SETTINGS* cfg = dynamic_cast( config() ) ) + { + if( cfg->m_LibrariesWidth > 0 ) + { + wxAuiPaneInfo& librariesPane = m_auimgr.GetPane( "Libraries" ); + + // wxAUI hack: force width by setting MinSize() and then Fixed() + // thanks to ZenJu http://trac.wxwidgets.org/ticket/13180 + librariesPane.MinSize( cfg->m_LibrariesWidth, -1 ); + librariesPane.BestSize( cfg->m_LibrariesWidth, -1 ); + librariesPane.MaxSize( cfg->m_LibrariesWidth, -1 ); + librariesPane.Fixed(); + m_auimgr.Update(); + + // now make it resizable again + librariesPane.MinSize( 20, -1 ); + librariesPane.Resizable(); + m_auimgr.Update(); + } + + if( cfg->m_FootprintsWidth > 0 ) + { + wxAuiPaneInfo& footprintsPane = m_auimgr.GetPane( "Footprints" ); + + // wxAUI hack: force width by setting MinSize() and then Fixed() + // thanks to ZenJu http://trac.wxwidgets.org/ticket/13180 + footprintsPane.MinSize( cfg->m_FootprintsWidth, -1 ); + footprintsPane.BestSize( cfg->m_FootprintsWidth, -1 ); + footprintsPane.MaxSize( cfg->m_FootprintsWidth, -1 ); + footprintsPane.Fixed(); + m_auimgr.Update(); + + // now make it resizable again + footprintsPane.MinSize( 20, -1 ); + footprintsPane.Resizable(); + m_auimgr.Update(); + } + } + // Connect Events setupEventHandlers(); @@ -420,6 +459,9 @@ void CVPCB_MAINFRAME::SaveSettings( APP_SETTINGS_BASE* aCfg ) auto cfg = static_cast( aCfg ); cfg->m_FilterFootprint = m_filteringOptions; + + cfg->m_LibrariesWidth = m_libListBox->GetSize().x; + cfg->m_FootprintsWidth = m_footprintListBox->GetSize().x; } diff --git a/cvpcb/cvpcb_settings.cpp b/cvpcb/cvpcb_settings.cpp index 502852c6b0..1e04658244 100644 --- a/cvpcb/cvpcb_settings.cpp +++ b/cvpcb/cvpcb_settings.cpp @@ -43,6 +43,9 @@ CVPCB_SETTINGS::CVPCB_SETTINGS() // Init settings: m_params.emplace_back( new PARAM( "filter_footprint", &m_FilterFootprint, 0 ) ); + m_params.emplace_back( new PARAM( "libraries_pane_width", &m_LibrariesWidth, 0 ) ); + m_params.emplace_back( new PARAM( "footprints_pane_width", &m_FootprintsWidth, 0 ) ); + addParamsForWindow( &m_FootprintViewer, "footprint_viewer" ); m_params.emplace_back( new PARAM( "footprint_viewer.pad_fill", diff --git a/cvpcb/cvpcb_settings.h b/cvpcb/cvpcb_settings.h index 5cfe182215..1a1fefa929 100644 --- a/cvpcb/cvpcb_settings.h +++ b/cvpcb/cvpcb_settings.h @@ -48,6 +48,8 @@ public: double m_FootprintViewerZoom; int m_FilterFootprint; + int m_LibrariesWidth; + int m_FootprintsWidth; protected: