mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 20:55:54 +08:00
Also set clipping for string
This commit is contained in:
parent
1d1f10f853
commit
527e5775a7
@ -153,7 +153,10 @@ SettingItem
|
|||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
|
|
||||||
maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 10
|
maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 10
|
||||||
clip: definition.type == "[int]" // Only clip for the list
|
|
||||||
|
// Since [int] & str don't have a max length, they need to be clipped (since clipping is expensive, this
|
||||||
|
// should be done as little as possible)
|
||||||
|
clip: definition.type == "str" || definition.type == "[int]"
|
||||||
|
|
||||||
validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,9}\s*,)*(\s*-?[0-9]{0,9})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : (definition.type == "float") ? /^-?[0-9]{0,9}[.,]?[0-9]{0,3}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry
|
validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,9}\s*,)*(\s*-?[0-9]{0,9})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : (definition.type == "float") ? /^-?[0-9]{0,9}[.,]?[0-9]{0,3}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user