From 213b600b54c1211720c28168601cd83760f4b281 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Wed, 14 Mar 2018 21:51:58 -0400 Subject: [PATCH] Revert active layer behavior so gerber/drill load behavior matches Fixes: lp:1755713 * https://bugs.launchpad.net/kicad/+bug/1755713 --- gerbview/files.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gerbview/files.cpp b/gerbview/files.cpp index ae9a42e57c..ef01d2d35d 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -231,7 +231,6 @@ bool GERBVIEW_FRAME::loadListOfGerberFiles( const wxString& aPath, // Read gerber files: each file is loaded on a new GerbView layer bool success = true; int layer = GetActiveLayer(); - int first_layer = layer; int visibility = GetVisibleLayers(); // Manage errors when loading files @@ -315,7 +314,14 @@ bool GERBVIEW_FRAME::loadListOfGerberFiles( const wxString& aPath, // Synchronize layers tools with actual active layer: ReFillLayerWidget(); - SetActiveLayer( first_layer, true ); + + // TODO: it would be nice if we could set the active layer to one of the + // ones that was just loaded, but to maintain the previous user experience + // we need to set it to a blank layer in case they load another file. + // We can't start with the next available layer when loading files because + // some users expect the behavior of overwriting the active layer on load. + SetActiveLayer( getNextAvailableLayer( layer ), true ); + m_LayersManager->UpdateLayerIcons(); syncLayerBox( true );