mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Merge branch '4.3'
This commit is contained in:
commit
4bf8ea9332
6 changed files with 128 additions and 18 deletions
|
|
@ -35,6 +35,7 @@ UM.TooltipArea
|
|||
property alias labelWidth: fieldLabel.width
|
||||
property alias unitText: unitLabel.text
|
||||
|
||||
property alias textField: textFieldWithUnit
|
||||
property alias valueText: textFieldWithUnit.text
|
||||
property alias valueValidator: textFieldWithUnit.validator
|
||||
property alias editingFinishedFunction: textFieldWithUnit.editingFinishedFunction
|
||||
|
|
@ -43,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
|
||||
|
|
@ -153,7 +156,13 @@ UM.TooltipArea
|
|||
const value = propertyProvider.properties.value
|
||||
return value ? value : ""
|
||||
}
|
||||
validator: RegExpValidator { regExp: allowNegativeValue ? /-?[0-9\.,]{0,6}/ : /[0-9\.,]{0,6}/ }
|
||||
validator: DoubleValidator
|
||||
{
|
||||
bottom: allowNegativeValue ? Number.NEGATIVE_INFINITY : 0
|
||||
top: allowPositiveValue ? Number.POSITIVE_INFINITY : 0
|
||||
decimals: 6
|
||||
notation: DoubleValidator.StandardNotation
|
||||
}
|
||||
|
||||
onEditingFinished: editingFinishedFunction()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue