Merge branch 'development' of https://github.com/MatterHackers/MatterControl into development

This commit is contained in:
Kevin Pope 2015-01-07 11:12:24 -08:00
commit 884ad8ed36
2 changed files with 18 additions and 22 deletions

View file

@ -166,19 +166,29 @@ namespace MatterHackers.MatterControl
ColumnOne.Width = ColumnOneFixedWidth; //Ordering here matters - must go after children are added
}
int columnTwoRequestCount = 0;
void LoadColumnTwo(object state = null)
{
ColumnTwo.CloseAndRemoveAllChildren();
UiThread.RunOnIdle((state2) =>
columnTwoRequestCount++;
if (columnTwoRequestCount == 1)
{
PartPreviewContent partViewContent = new PartPreviewContent(PrinterConnectionAndCommunication.Instance.ActivePrintItem, View3DWidget.WindowMode.Embeded, View3DWidget.AutoRotate.Enabled);
partViewContent.AnchorAll();
ColumnTwo.CloseAndRemoveAllChildren();
ColumnTwo.AddChild(partViewContent);
});
UiThread.RunOnIdle((state2) =>
{
PartPreviewContent partViewContent = new PartPreviewContent(PrinterConnectionAndCommunication.Instance.ActivePrintItem, View3DWidget.WindowMode.Embeded, View3DWidget.AutoRotate.Enabled);
partViewContent.AnchorAll();
ColumnTwo.AnchorAll();
ColumnTwo.AddChild(partViewContent);
columnTwoRequestCount--;
if (columnTwoRequestCount > 0)
{
UiThread.RunOnIdle(LoadColumnTwo);
}
});
ColumnTwo.AnchorAll();
}
}
int NumberOfVisiblePanels()

View file

@ -70,20 +70,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
ShowAsSystemWindow();
}
#if __ANDROID__
Stopwatch totalDrawTime = new Stopwatch();
AverageMillisecondTimer millisecondTimer = new AverageMillisecondTimer();
public override void OnDraw(Graphics2D graphics2D)
{
totalDrawTime.Restart();
base.OnDraw(graphics2D);
totalDrawTime.Stop();
millisecondTimer.Update((int)totalDrawTime.ElapsedMilliseconds);
millisecondTimer.Draw(graphics2D, this.Width * 3 / 4 - 15, this.Height - 40);
}
#endif
private void AddHandlers()
{
ActiveTheme.Instance.ThemeChanged.RegisterEvent(ThemeChanged, ref unregisterEvents);