Merge branch '1.5.0'
Conflicts: StaticData/Translations/Master.txt
This commit is contained in:
commit
e4a761bdd9
52 changed files with 630 additions and 468 deletions
|
|
@ -119,7 +119,12 @@ namespace MatterHackers.MatterControl.ConfigurationPage
|
|||
buttonRow.AddChild(editButton);
|
||||
buttonRow.AddChild(new HorizontalSpacer());
|
||||
buttonRow.AddChild(runPrintLevelingButton);
|
||||
buttonRow.AddChild(printLevelingSwitch);
|
||||
|
||||
// only show the switch if leveling can be turned off (it can't if it is required).
|
||||
if (!ActiveSliceSettings.Instance.LevelingRequiredToPrint)
|
||||
{
|
||||
buttonRow.AddChild(printLevelingSwitch);
|
||||
}
|
||||
|
||||
SetPrintLevelButtonVisiblity();
|
||||
return buttonRow;
|
||||
|
|
|
|||
|
|
@ -51,11 +51,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
}
|
||||
}
|
||||
|
||||
public bool NeedsPrintLeveling
|
||||
{
|
||||
get { return ActiveSliceSettings.Instance.GetActiveValue("print_leveling_required_to_print") == "1"; }
|
||||
}
|
||||
|
||||
public Vector3 ProbeOffset0
|
||||
{
|
||||
get { return probeOffset0Private; }
|
||||
|
|
|
|||
|
|
@ -54,91 +54,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage
|
|||
private EditLevelingSettingsWindow editLevelingSettingsWindow;
|
||||
private TextWidget printLevelingStatusLabel;
|
||||
|
||||
private FlowLayoutWidget GetAutoLevelControl()
|
||||
{
|
||||
FlowLayoutWidget buttonRow = new FlowLayoutWidget();
|
||||
buttonRow.HAnchor = HAnchor.ParentLeftRight;
|
||||
buttonRow.Margin = new BorderDouble(0, 4);
|
||||
|
||||
TextWidget notificationSettingsLabel = new TextWidget("Software Print Leveling");
|
||||
notificationSettingsLabel.AutoExpandBoundsToText = true;
|
||||
notificationSettingsLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
notificationSettingsLabel.VAnchor = VAnchor.ParentCenter;
|
||||
|
||||
Button editButton = textImageButtonFactory.GenerateEditButton();
|
||||
editButton.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
editButton.Click += (sender, e) =>
|
||||
{
|
||||
UiThread.RunOnIdle(() =>
|
||||
{
|
||||
if (editLevelingSettingsWindow == null)
|
||||
{
|
||||
editLevelingSettingsWindow = new EditLevelingSettingsWindow();
|
||||
editLevelingSettingsWindow.Closed += (sender2, e2) =>
|
||||
{
|
||||
editLevelingSettingsWindow = null;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
editLevelingSettingsWindow.BringToFront();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Button runPrintLevelingButton = textImageButtonFactory.Generate("Configure".Localize().ToUpper());
|
||||
runPrintLevelingButton.Margin = new BorderDouble(left: 6);
|
||||
runPrintLevelingButton.VAnchor = VAnchor.ParentCenter;
|
||||
runPrintLevelingButton.Click += (sender, e) =>
|
||||
{
|
||||
UiThread.RunOnIdle(() =>
|
||||
{
|
||||
LevelWizardBase.ShowPrintLevelWizard(LevelWizardBase.RuningState.UserRequestedCalibration);
|
||||
});
|
||||
};
|
||||
|
||||
Agg.Image.ImageBuffer levelingImage = StaticData.Instance.LoadIcon(Path.Combine("PrintStatusControls", "leveling-24x24.png"));
|
||||
if (!ActiveTheme.Instance.IsDarkTheme)
|
||||
{
|
||||
InvertLightness.DoInvertLightness(levelingImage);
|
||||
}
|
||||
|
||||
ImageWidget levelingIcon = new ImageWidget(levelingImage);
|
||||
levelingIcon.Margin = new BorderDouble(right: 6);
|
||||
|
||||
CheckBox printLevelingSwitch = ImageButtonFactory.CreateToggleSwitch(ActivePrinterProfile.Instance.DoPrintLeveling);
|
||||
printLevelingSwitch.VAnchor = VAnchor.ParentCenter;
|
||||
printLevelingSwitch.Margin = new BorderDouble(left: 16);
|
||||
printLevelingSwitch.CheckedStateChanged += (sender, e) =>
|
||||
{
|
||||
ActivePrinterProfile.Instance.DoPrintLeveling = printLevelingSwitch.Checked;
|
||||
};
|
||||
|
||||
printLevelingStatusLabel = new TextWidget("");
|
||||
printLevelingStatusLabel.AutoExpandBoundsToText = true;
|
||||
printLevelingStatusLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
printLevelingStatusLabel.VAnchor = VAnchor.ParentCenter;
|
||||
|
||||
GuiWidget hSpacer = new GuiWidget();
|
||||
hSpacer.HAnchor = HAnchor.ParentLeftRight;
|
||||
|
||||
ActivePrinterProfile.Instance.DoPrintLevelingChanged.RegisterEvent((sender, e) =>
|
||||
{
|
||||
SetPrintLevelButtonVisiblity();
|
||||
printLevelingSwitch.Checked = ActivePrinterProfile.Instance.DoPrintLeveling;
|
||||
}, ref unregisterEvents);
|
||||
|
||||
buttonRow.AddChild(levelingIcon);
|
||||
buttonRow.AddChild(printLevelingStatusLabel);
|
||||
buttonRow.AddChild(editButton);
|
||||
buttonRow.AddChild(new HorizontalSpacer());
|
||||
buttonRow.AddChild(runPrintLevelingButton);
|
||||
buttonRow.AddChild(printLevelingSwitch);
|
||||
|
||||
SetPrintLevelButtonVisiblity();
|
||||
return buttonRow;
|
||||
}
|
||||
|
||||
public override void OnClosed(EventArgs e)
|
||||
{
|
||||
if (unregisterEvents != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue