Add MainView to form before closing progress overlay

- Ensures that expensive layout occurs before shutdown progress
This commit is contained in:
John Lewin 2017-12-18 10:53:00 -08:00
parent 7686bec8b6
commit a7f0c1f7ab

View file

@ -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