Remember selected tab index between ReloadX events

This commit is contained in:
John Lewin 2017-06-03 19:27:30 -07:00
parent d80a88e876
commit 97b2bc2c8a
2 changed files with 13 additions and 11 deletions

View file

@ -92,6 +92,10 @@ namespace MatterHackers.MatterControl
private TabControl CreateTabControl()
{
var newTabControl = ApplicationController.Instance.Theme.CreateTabControl();
newTabControl.TabBar.TabIndexChanged += (s, e) =>
{
ApplicationController.Instance.ActiveAdvancedControlsTab = newTabControl.SelectedTabIndex;
};
RGBA_Bytes unselectedTextColor = ActiveTheme.Instance.TabLabelUnselected;
@ -129,14 +133,6 @@ namespace MatterHackers.MatterControl
newTabControl.AddTab(sliceSettingPopOut);
newTabControl.AddTab(controlsPopOut);
#if !__ANDROID__
if (!UserSettings.Instance.IsTouchScreen)
{
MenuOptionSettings.sliceSettingsPopOut = sliceSettingPopOut;
MenuOptionSettings.controlsPopOut = controlsPopOut;
}
#endif
newTabControl.AddTab(
new SimpleTextTabWidget(
new TabPage(new PrinterConfigurationScrollWidget(), "Options".Localize().ToUpper()),
@ -144,9 +140,15 @@ namespace MatterHackers.MatterControl
newTabControl.TextPointSize,
ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
// MatterControl historically started with the queue selected, force to 0 to remain consistent
newTabControl.SelectedTabIndex = 0;
newTabControl.SelectedTabIndex = ApplicationController.Instance.ActiveAdvancedControlsTab;
#if !__ANDROID__
if (!UserSettings.Instance.IsTouchScreen)
{
MenuOptionSettings.sliceSettingsPopOut = sliceSettingPopOut;
MenuOptionSettings.controlsPopOut = controlsPopOut;
}
#endif
return newTabControl;
}
}

View file

@ -263,7 +263,6 @@ namespace MatterHackers.MatterControl
}
}
private async void ThumbGeneration()
{
while(true)
@ -710,6 +709,7 @@ namespace MatterHackers.MatterControl
public MeshViewState PartPreviewState { get; set; } = new MeshViewState();
public View3DWidget ActiveView3DWidget { get; internal set; }
public int ActiveAdvancedControlsTab { get; internal set; }
public string CachePath(ILibraryItem libraryItem)
{