Make the movement controls more suited to always being shown.

This commit is contained in:
Lars Brubaker 2017-02-17 16:46:38 -08:00
parent bef4ce80eb
commit 00a894bc27
2 changed files with 8 additions and 10 deletions

View file

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

View file

@ -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<double>(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.##");
}