Set MainTabKey when workspace is opened/added

- Issue MatterHackers/MCCentral#5383
MatterControl fails to switch to printer tab
This commit is contained in:
jlewin 2019-04-25 12:33:44 -07:00
parent da7dcd43f9
commit b6b3ad5f6e

View file

@ -405,6 +405,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
bool isPrinter = activePrinter?.Settings.PrinterSelected == true;
ChromeTab newTab = isPrinter ? CreatePrinterTab(workspace, theme) : CreatePartTab(workspace);
if (e.Operation == WorkspacesChangedEventArgs.OperationType.Add)
{
ApplicationController.Instance.MainTabKey = newTab.Key;
}
// Activate tab with previously active key
if (newTab.Key == ApplicationController.Instance.MainTabKey)
{