Browse Source

Escape - Cancel, Enter - Save support

QGC4.4
Don Gagne 10 years ago
parent
commit
a476b66fd0
  1. 9
      src/QmlControls/ParameterEditorDialog.qml

9
src/QmlControls/ParameterEditorDialog.qml

@ -59,6 +59,7 @@ QGCViewDialog {
validationError.text = fact.validate(validateValue, false /* convertOnly */) validationError.text = fact.validate(validateValue, false /* convertOnly */)
forceSave.visible = true forceSave.visible = true
} }
valueField.forceActiveFocus();
} }
Column { Column {
@ -82,6 +83,14 @@ QGCViewDialog {
QGCTextField { QGCTextField {
id: valueField id: valueField
text: validate ? validateValue : fact.valueString text: validate ? validateValue : fact.valueString
onAccepted: accept()
Keys.onReleased: {
if (event.key == Qt.Key_Escape) {
reject()
}
}
} }
QGCLabel { text: fact.name } QGCLabel { text: fact.name }

Loading…
Cancel
Save