Conditionally set ActiveTab based on MainTabKey

This commit is contained in:
jlewin 2019-04-24 15:08:53 -07:00
parent c128a454e9
commit 06d90678e9

View file

@ -400,15 +400,23 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
if (e.Operation == WorkspacesChangedEventArgs.OperationType.Add
|| e.Operation == WorkspacesChangedEventArgs.OperationType.Restore)
{
// Create and switch to new printer tab
if (activePrinter?.Settings.PrinterSelected == true)
{
tabControl.ActiveTab = this.CreatePrinterTab(e.Workspace, theme);
}
else
{
tabControl.ActiveTab = this.CreatePartTab(e.Workspace);
}
ChromeTab newTab;
// Create and switch to new printer tab
if (activePrinter?.Settings.PrinterSelected == true)
{
newTab = this.CreatePrinterTab(e.Workspace, theme);
}
else
{
newTab = this.CreatePartTab(e.Workspace);
}
// Activate tab with previously active key
if (newTab.Key == ApplicationController.Instance.MainTabKey)
{
tabControl.ActiveTab = newTab;
}
}
else
{