diff --git a/common/project/project_local_settings.cpp b/common/project/project_local_settings.cpp index 2fcde75796..27fa842b5c 100644 --- a/common/project/project_local_settings.cpp +++ b/common/project/project_local_settings.cpp @@ -154,6 +154,9 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin &m_RatsnestMode, RATSNEST_MODE::ALL, RATSNEST_MODE::ALL, RATSNEST_MODE::VISIBLE ) ); + m_params.emplace_back( new PARAM( "board.auto_track_width", + &m_AutoTrackWidth, true ) ); + m_params.emplace_back( new PARAM_ENUM( "board.zone_display_mode", &m_ZoneDisplayMode, ZONE_DISPLAY_MODE::SHOW_FILLED, ZONE_DISPLAY_MODE::SHOW_FILLED, @@ -271,7 +274,7 @@ bool PROJECT_LOCAL_SETTINGS::SaveToFile( const wxString& aDirectory, bool aForce const PROJECT_FILE_STATE* PROJECT_LOCAL_SETTINGS::GetFileState( const wxString& aFileName ) { - auto it = std::find_if( m_files.begin(), m_files.end(), + auto it = std::find_if( m_files.begin(), m_files.end(), [&aFileName]( const PROJECT_FILE_STATE &a ) { return a.fileName == aFileName; @@ -290,9 +293,9 @@ void PROJECT_LOCAL_SETTINGS::SaveFileState( const wxString& aFileName, const WINDOW_SETTINGS* aWindowCfg, bool aOpen ) { auto it = std::find_if( m_files.begin(), m_files.end(), - [&aFileName]( const PROJECT_FILE_STATE& a ) - { - return a.fileName == aFileName; + [&aFileName]( const PROJECT_FILE_STATE& a ) + { + return a.fileName == aFileName; } ); if( it == m_files.end() ) diff --git a/include/project/project_local_settings.h b/include/project/project_local_settings.h index 305eb188bf..8f095eb98f 100644 --- a/include/project/project_local_settings.h +++ b/include/project/project_local_settings.h @@ -116,6 +116,9 @@ public: /// The current ratsnest draw mode RATSNEST_MODE m_RatsnestMode; + /// The current setting for whether to automatically adjust track widths to match + bool m_AutoTrackWidth; + /// How zones are drawn ZONE_DISPLAY_MODE m_ZoneDisplayMode; diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index 7ac6637746..bbf35ff6a6 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -134,6 +134,9 @@ bool PCB_EDIT_FRAME::LoadProjectSettings() opts.m_ZoneDisplayMode = localSettings.m_ZoneDisplayMode; SetDisplayOptions( opts ); + BOARD_DESIGN_SETTINGS& bds = GetDesignSettings(); + bds.m_UseConnectedTrackWidth = localSettings.m_AutoTrackWidth; + wxFileName fn( GetCurrentFileName() ); fn.MakeRelativeTo( Prj().GetProjectPath() ); LoadWindowState( fn.GetFullPath() ); @@ -181,6 +184,10 @@ void PCB_EDIT_FRAME::SaveProjectSettings() localSettings.m_ZoneOpacity = displayOpts.m_ZoneOpacity; localSettings.m_ZoneDisplayMode = displayOpts.m_ZoneDisplayMode; + // Save Design settings + const BOARD_DESIGN_SETTINGS& bds = GetDesignSettings(); + localSettings.m_AutoTrackWidth = bds.m_UseConnectedTrackWidth; + // Save render settings that aren't stored in PCB_DISPLAY_OPTIONS KIGFX::PCB_RENDER_SETTINGS* rs = static_cast(