diff --git a/src/QmlControls/ParameterEditorDialog.qml b/src/QmlControls/ParameterEditorDialog.qml index 54b1ac87ec1405b6bc52ee8739056a1686390b93..8834f0a39fd486ab82839d768250298c949648d7 100644 --- a/src/QmlControls/ParameterEditorDialog.qml +++ b/src/QmlControls/ParameterEditorDialog.qml @@ -59,6 +59,7 @@ QGCViewDialog { validationError.text = fact.validate(validateValue, false /* convertOnly */) forceSave.visible = true } + valueField.forceActiveFocus(); } Column { @@ -82,6 +83,14 @@ QGCViewDialog { QGCTextField { id: valueField text: validate ? validateValue : fact.valueString + + onAccepted: accept() + + Keys.onReleased: { + if (event.key == Qt.Key_Escape) { + reject() + } + } } QGCLabel { text: fact.name } diff --git a/src/QmlControls/QGCTextField.qml b/src/QmlControls/QGCTextField.qml index ba3f678f7dbd886f2e6315027fdd18e478de14d0..3facce0f468fe660cf94988bdc6d023e6522fcb8 100644 --- a/src/QmlControls/QGCTextField.qml +++ b/src/QmlControls/QGCTextField.qml @@ -60,4 +60,10 @@ TextField { padding.right: control.showUnits ? unitsLabelWidthGenerator.width : control.__contentHeight/3 } + + onActiveFocusChanged: { + if (activeFocus) { + selectAll() + } + } }