From fb875145aa37a2421757426e355b164399304454 Mon Sep 17 00:00:00 2001 From: Michael Kavanagh Date: Sat, 30 Mar 2019 17:45:10 +0000 Subject: [PATCH] Read Footprint Library Browser grid settings from Footprint Editor. Implements commit 3a0dbf48c88d199be089a31aab76519e5da22360 for Footprint Library Browser/Editor. Fixes: lp:1822401 https://bugs.launchpad.net/kicad/+bug/1822401 (cherry picked from commit a611269975d98d28c4d43e39d5b92eaa4444c180) --- pcbnew/footprint_viewer_frame.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 3bced911f8..7bf3adbd3b 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -501,6 +501,20 @@ void FOOTPRINT_VIEWER_FRAME::LoadSettings( wxConfigBase* aCfg ) { PCB_BASE_FRAME::LoadSettings( aCfg ); + // Fetch grid settings from Footprint Editor + wxString footprintEditor = FOOTPRINT_EDIT_FRAME_NAME; + bool btmp; + COLOR4D wtmp; + + if( aCfg->Read( footprintEditor + ShowGridEntryKeyword, &btmp ) ) + SetGridVisibility( btmp ); + + if( wtmp.SetFromWxString( aCfg->Read( footprintEditor + GridColorEntryKeyword, wxT( "NONE" ) ) ) ) + SetGridColor( wtmp ); + + // Grid shape, etc. + GetGalDisplayOptions().ReadConfig( aCfg, footprintEditor + GAL_DISPLAY_OPTIONS_KEY ); + m_configSettings.Load( aCfg ); // mainly, load the color config aCfg->Read( ConfigBaseName() + AUTO_ZOOM_KEY, &m_autoZoom, true );