forked from Silverfish/proton-bridge
Shared GUI for Bridge and Import/Export
This commit is contained in:
@ -138,6 +138,11 @@ Column {
|
||||
}
|
||||
}
|
||||
|
||||
function clear() {
|
||||
inputField.text = ""
|
||||
rightIcon = ""
|
||||
}
|
||||
|
||||
function checkNonEmpty() {
|
||||
if (inputField.text == "") {
|
||||
rightIcon = Style.fa.exclamation_triangle
|
||||
@ -154,6 +159,17 @@ Column {
|
||||
if (root.isPassword) inputField.echoMode = TextInput.Password
|
||||
}
|
||||
|
||||
function checkIsANumber(){
|
||||
if (/^\d+$/.test(inputField.text)) {
|
||||
rightIcon = Style.fa.check_circle
|
||||
return true
|
||||
}
|
||||
rightIcon = Style.fa.exclamation_triangle
|
||||
root.placeholderText = ""
|
||||
inputField.focus = true
|
||||
return false
|
||||
}
|
||||
|
||||
function forceFocus() {
|
||||
inputField.forceActiveFocus()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user