From a7f0c1f7ab101e9d1c73277cc13d3ce77f2d3d22 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 18 Dec 2017 10:53:00 -0800 Subject: [PATCH] Add MainView to form before closing progress overlay - Ensures that expensive layout occurs before shutdown progress --- Program.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Program.cs b/Program.cs index 832dfd72b..5b6d9f0f1 100644 --- a/Program.cs +++ b/Program.cs @@ -65,13 +65,18 @@ namespace MatterHackers.MatterControl BackgroundColor = Color.DarkGray }; + var overlay = new GuiWidget(); + overlay.AnchorAll(); + + systemWindow.AddChild(overlay); + progressPanel = new FlowLayoutWidget(FlowDirection.TopToBottom) { HAnchor = HAnchor.Center, VAnchor = VAnchor.Center, MinimumSize = new VectorMath.Vector2(400, 100), }; - systemWindow.AddChild(progressPanel); + overlay.AddChild(progressPanel); progressPanel.AddChild(statusText = new TextWidget("", textColor: new Color("#bbb")) { @@ -108,14 +113,11 @@ namespace MatterHackers.MatterControl }); ReportStartupProgress(0.9, "AddChild->MainView"); - systemWindow.RemoveAllChildren(); - systemWindow.AddChild(mainView); + systemWindow.AddChild(mainView, 0); ReportStartupProgress(1, ""); - systemWindow.BackgroundColor = Color.Transparent; - - systemWindow.Invalidate(); + overlay.Close(); // TODO: Still can't figure out the delay between concluding this block and the first actual render with MainView content. Current // best guess is delays between widget construction and OpenGL texture creation