Drop statics, use instance members

This commit is contained in:
John Lewin 2017-09-25 22:27:46 -07:00
parent 6e6b0b951b
commit 57ded486a4
3 changed files with 10 additions and 10 deletions

View file

@ -708,7 +708,8 @@ namespace MatterHackers.MatterControl
public View3DWidget ActiveView3DWidget { get; internal set; }
public string PrintingItemName { get; set; }
public string ProductName { get { return "MatterHackers: XForge"; } }
public string ProductName => "MatterHackers: XForge";
public string CachePath(ILibraryItem libraryItem)
{

View file

@ -70,7 +70,7 @@ namespace MatterHackers.MatterControl
leftNav.AddChild(new BrandMenuButton()
{
MinimumSize = new VectorMath.Vector2(0, 32),
MinimumSize = new VectorMath.Vector2(0, 34),
HAnchor = HAnchor.Stretch,
VAnchor = VAnchor.Fit
});
@ -100,7 +100,7 @@ namespace MatterHackers.MatterControl
VAnchor = VAnchor.Fit,
Margin = new BorderDouble(6, 0)
};
var icon = AggContext.StaticData.LoadImage(Path.Combine("Images", "mh-app-logo.png"));
if (ActiveTheme.Instance.IsDarkTheme)
{

View file

@ -104,7 +104,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
protected GuiWidget GetPopupContent()
{
var widget = new IgnoredPopupWidget()
var popupContainer = new IgnoredPopupWidget()
{
HAnchor = HAnchor.Fit,
VAnchor = VAnchor.Fit,
@ -117,14 +117,13 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
MinimumSize = new VectorMath.Vector2(400, 500)
};
widget.AddChild(progressContainer);
popupContainer.AddChild(progressContainer);
var sliceButton = buttonFactory.Generate("Slice".Localize().ToUpper());
widget.AddChild(sliceButton);
popupContainer.AddChild(sliceButton);
sliceButton.ToolTipText = "Slice Parts".Localize();
sliceButton.Name = "Generate Gcode Button";
//sliceButton.Margin = defaultMargin;
sliceButton.Click += async (s, e) =>
{
if (printer.Settings.PrinterSelected)
@ -142,14 +141,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
sliceProgressReporter.StartReporting();
// Save any pending changes before starting the print
await ApplicationController.Instance.ActiveView3DWidget.PersistPlateIfNeeded();
await printerTabPage.modelViewer.PersistPlateIfNeeded();
await SlicingQueue.SliceFileAsync(printItem, sliceProgressReporter);
sliceProgressReporter.EndReporting();
var gcodeLoadCancellationTokenSource = new CancellationTokenSource();
ApplicationController.Instance.ActivePrinter.Bed.LoadGCode(printItem.GetGCodePathAndFileName(), gcodeLoadCancellationTokenSource.Token, printerTabPage.modelViewer.gcodeViewer.LoadProgress_Changed);
this.printer.Bed.LoadGCode(printItem.GetGCodePathAndFileName(), gcodeLoadCancellationTokenSource.Token, printerTabPage.modelViewer.gcodeViewer.LoadProgress_Changed);
printerTabPage.ViewMode = PartViewMode.Layers3D;
@ -173,7 +172,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
};
return widget;
return popupContainer;
}
}