diff --git a/CustomWidgets/PrintingWindow.cs b/CustomWidgets/PrintingWindow.cs index 33db3f2ad..a5c326bf6 100644 --- a/CustomWidgets/PrintingWindow.cs +++ b/CustomWidgets/PrintingWindow.cs @@ -849,15 +849,13 @@ namespace MatterHackers.MatterControl.CustomWidgets Margin = new BorderDouble(bottom: 8) }); - this.AddChild(CreateZMoveButton(1, smallScreen)); - this.AddChild(CreateZMoveButton(.1, smallScreen)); this.AddChild(CreateZMoveButton(.02, smallScreen)); - this.AddChild(new ZTuningWidget() + this.AddChild(new ZTuningWidget(false) { - HAnchor = HAnchor.ParentCenter, + HAnchor = HAnchor.ParentCenter | HAnchor.FitToChildren, Margin = 10 }); @@ -865,8 +863,6 @@ namespace MatterHackers.MatterControl.CustomWidgets this.AddChild(CreateZMoveButton(-.1, smallScreen)); - this.AddChild(CreateZMoveButton(-1, smallScreen)); - this.AddChild(new TextWidget("Z-", pointSize: smallScreen ? 12 : 15, textColor: ActiveTheme.Instance.PrimaryTextColor) { HAnchor = HAnchor.ParentCenter, diff --git a/PrinterControls/ControlWidgets/MovementControls.cs b/PrinterControls/ControlWidgets/MovementControls.cs index 0cfb64ee5..7972fb95f 100644 --- a/PrinterControls/ControlWidgets/MovementControls.cs +++ b/PrinterControls/ControlWidgets/MovementControls.cs @@ -330,9 +330,11 @@ namespace MatterHackers.MatterControl.PrinterControls private FlowLayoutWidget zOffsetStreamContainer; private EventHandler unregisterEvents; + private bool allowRemoveButton; - public ZTuningWidget() + public ZTuningWidget(bool allowRemoveButton = true) { + this.allowRemoveButton = allowRemoveButton; this.HAnchor = HAnchor.FitToChildren; this.VAnchor = VAnchor.FitToChildren | VAnchor.ParentCenter; @@ -376,7 +378,7 @@ namespace MatterHackers.MatterControl.PrinterControls VAnchor = VAnchor.ParentCenter, Margin = new BorderDouble(0, 0, 5, 0), ToolTipText = "Clear ZOffset".Localize(), - Visible = zoffset != 0 + Visible = allowRemoveButton && zoffset != 0 }; clearZOffsetButton.Click += (sender, e) => { @@ -390,8 +392,8 @@ namespace MatterHackers.MatterControl.PrinterControls double zoffset = ActiveSliceSettings.Instance.GetValue(SettingsKey.baby_step_z_offset); bool hasOverriddenZOffset = (zoffset != 0); - zOffsetStreamContainer.BackgroundColor = (hasOverriddenZOffset) ? SliceSettingsWidget.userSettingBackgroundColor : ActiveTheme.Instance.SecondaryBackgroundColor; - clearZOffsetButton.Visible = hasOverriddenZOffset; + zOffsetStreamContainer.BackgroundColor = (allowRemoveButton && hasOverriddenZOffset) ? SliceSettingsWidget.userSettingBackgroundColor : ActiveTheme.Instance.SecondaryBackgroundColor; + clearZOffsetButton.Visible = allowRemoveButton && hasOverriddenZOffset; zOffsetStreamDisplay.Text = zoffset.ToString("0.##"); }