From fab40e17a84761832fec575f1d28dc8ca79ac6cb Mon Sep 17 00:00:00 2001 From: larsbrubaker Date: Thu, 3 Jul 2014 16:39:36 -0700 Subject: [PATCH] Made the wide screen panel be the thing that is recreated on ReloadAll. --- ApplicationView/MainApplicationWidget.cs | 6 +----- ApplicationView/WidescreenPanel.cs | 2 +- PrintQueue/QueueDataView.cs | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ApplicationView/MainApplicationWidget.cs b/ApplicationView/MainApplicationWidget.cs index d1acbfdda..b3fb29365 100644 --- a/ApplicationView/MainApplicationWidget.cs +++ b/ApplicationView/MainApplicationWidget.cs @@ -98,11 +98,7 @@ namespace MatterHackers.MatterControl UiThread.RunOnIdle((state) => { // give the widget a chance to hear about the close before they are actually colsed. - bool cancelClose; - this.OnClosing(out cancelClose); - - this.CloseAndRemoveAllChildren(); - AddElements(); + widescreenPanel.RecreateAllPanels(); }); } diff --git a/ApplicationView/WidescreenPanel.cs b/ApplicationView/WidescreenPanel.cs index f8eb43d8a..ebe6266f4 100644 --- a/ApplicationView/WidescreenPanel.cs +++ b/ApplicationView/WidescreenPanel.cs @@ -229,7 +229,7 @@ namespace MatterHackers.MatterControl } } - void RecreateAllPanels(object state = null) + public void RecreateAllPanels(object state = null) { if (Width == 0) { diff --git a/PrintQueue/QueueDataView.cs b/PrintQueue/QueueDataView.cs index fb748ea50..489e27361 100644 --- a/PrintQueue/QueueDataView.cs +++ b/PrintQueue/QueueDataView.cs @@ -346,6 +346,7 @@ namespace MatterHackers.MatterControl.PrintQueue WidescreenPanel.PreChangePannels.RegisterEvent(SaveCurrentlySelctedItemIndex, ref unregisterEvents); + selectedQueueItemIndex = Math.Min(selectedQueueItemIndex, QueueData.Instance.Count-1); SelectedIndex = selectedQueueItemIndex; }