diff --git a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml index 63c32d36cc..045b8d1e99 100644 --- a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml +++ b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml @@ -208,6 +208,7 @@ Item axisName: "x" axisMinOrMax: "min" allowNegativeValue: true + allowPositiveValue: false forceUpdateOnChangeFunction: forceUpdateFunction } @@ -227,6 +228,7 @@ Item axisName: "y" axisMinOrMax: "min" allowNegativeValue: true + allowPositiveValue: false forceUpdateOnChangeFunction: forceUpdateFunction } @@ -246,6 +248,7 @@ Item axisName: "x" axisMinOrMax: "max" allowNegativeValue: false + allowPositiveValue: true forceUpdateOnChangeFunction: forceUpdateFunction } @@ -267,6 +270,7 @@ Item axisName: "y" axisMinOrMax: "max" allowNegativeValue: false + allowPositiveValue: true forceUpdateOnChangeFunction: forceUpdateFunction } diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index 049282a6a0..bad7f5a867 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -44,6 +44,8 @@ UM.TooltipArea // whether negative value is allowed. This affects the validation of the input field. property bool allowNegativeValue: false + // whether positive value is allowed. This affects the validation of the input field. + property bool allowPositiveValue: true // callback functions property var afterOnEditingFinishedFunction: dummy_func diff --git a/resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml b/resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml index b78c1ae0db..8919271f05 100644 --- a/resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml +++ b/resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml @@ -48,9 +48,11 @@ NumericTextFieldWithUnit valueValidator: DoubleValidator { bottom: allowNegativeValue ? Number.NEGATIVE_INFINITY : 0 + top: allowPositiveValue ? Number.POSITIVE_INFINITY : 0 decimals: 6 notation: DoubleValidator.StandardNotation } + valueText: axisValue editingFinishedFunction: function()