diff --git a/common/settings/app_settings.cpp b/common/settings/app_settings.cpp index 2d8028d777..e2713d8698 100644 --- a/common/settings/app_settings.cpp +++ b/common/settings/app_settings.cpp @@ -42,7 +42,7 @@ APP_SETTINGS_BASE::APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaV m_appSettingsSchemaVersion( aSchemaVersion ) { // Make Coverity happy: - m_LibTree.column_width = 360; + m_LibTree.column_width = 300; m_Graphics.canvas_type = EDA_DRAW_PANEL_GAL::GAL_FALLBACK; // Build parameters list: @@ -73,13 +73,7 @@ APP_SETTINGS_BASE::APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaV &m_ColorPicker.default_tab, 0 ) ); m_params.emplace_back( new PARAM( "lib_tree.column_width", - &m_LibTree.column_width, 360 ) ); - - // Now that we allow hiding/showing of the tree control, it's never terribly useful to - // decrease the width to nothing, and wxWidgets appears to have some bugs where it sets it - // way too narrow. - if( m_LibTree.column_width < 360 ) - m_LibTree.column_width = 360; + &m_LibTree.column_width, 300 ) ); m_params.emplace_back( new PARAM( "printing.background", &m_Printing.background, false ) ); diff --git a/eeschema/eeschema_settings.cpp b/eeschema/eeschema_settings.cpp index 77ea5d5e2e..a32819b93c 100644 --- a/eeschema/eeschema_settings.cpp +++ b/eeschema/eeschema_settings.cpp @@ -40,7 +40,7 @@ using namespace T_BOMCFG_T; // for the BOM_CFG_PARSER parser and its keywords ///! Update the schema version whenever a migration is required -const int eeschemaSchemaVersion = 1; +const int eeschemaSchemaVersion = 2; /// Default value for bom.plugins const nlohmann::json defaultBomPlugins = @@ -446,6 +446,21 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() : // Version 0 to 1: BOM plugin settings moved from sexpr to JSON return migrateBomSettings(); } ); + + + registerMigration( 1, 2, + [&]() -> bool + { + // We used to have a bug on GTK which would set the lib tree column width way + // too narrow. + if( OPT optval = Get( "lib_tree.column_width" ) ) + { + if( optval < 150 ) + Set( "lib_tree.column_width", 300 ); + } + + return true; + } ); } diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 5abc0e44aa..8a741d3c4f 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -43,7 +43,7 @@ ///! Update the schema version whenever a migration is required -const int pcbnewSchemaVersion = 2; +const int pcbnewSchemaVersion = 3; PCBNEW_SETTINGS::PCBNEW_SETTINGS() @@ -578,6 +578,20 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() return true; } ); + + registerMigration( 2, 3, + [&]() -> bool + { + // We used to have a bug on GTK which would set the lib tree column width way + // too narrow. + if( OPT optval = Get( "lib_tree.column_width" ) ) + { + if( optval < 150 ) + Set( "lib_tree.column_width", 300 ); + } + + return true; + } ); }