From bee8528c2bc0b0b7c87f190c6c83dc389be4cc38 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Fri, 4 Aug 2023 14:17:11 -0700 Subject: [PATCH] Prevent virtual keyboard from popping up on combo box entry --- src/QmlControls/ParameterEditorDialog.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/QmlControls/ParameterEditorDialog.qml b/src/QmlControls/ParameterEditorDialog.qml index 3627050..f0bdf70 100644 --- a/src/QmlControls/ParameterEditorDialog.qml +++ b/src/QmlControls/ParameterEditorDialog.qml @@ -38,6 +38,7 @@ QGCPopupDialog { property bool _editingParameter: fact.componentId != 0 property bool _allowForceSave: QGroundControl.corePlugin.showAdvancedUI || !_editingParameter property bool _allowDefaultReset: fact.defaultValueAvailable && (QGroundControl.corePlugin.showAdvancedUI || !_editingParameter) + property bool _showCombo: fact.enumStrings.length !== 0 && fact.bitmaskStrings.length === 0 && !validate ParameterEditorController { id: controller; } @@ -114,11 +115,11 @@ QGCPopupDialog { text: validate ? validateValue : fact.valueString unitsLabel: fact.units showUnits: fact.units != "" - focus: setFocus - inputMethodHints: (fact.typeIsString || ScreenTools.isiOS) ? - Qt.ImhNone : // iOS numeric keyboard has no done button, we can't use it + focus: setFocus && visible + inputMethodHints: (fact.typeIsString || ScreenTools.isiOS) ? // iOS numeric keyboard has no done button, we can't use it + Qt.ImhNone : Qt.ImhFormattedNumbersOnly // Forces use of virtual numeric keyboard - visible: fact.enumStrings.length === 0 || validate || manualEntry.checked + visible: !_showCombo || validate || manualEntry.checked } QGCComboBox { @@ -126,8 +127,7 @@ QGCPopupDialog { width: _editFieldWidth model: fact.enumStrings visible: _showCombo - - property bool _showCombo: fact.enumStrings.length !== 0 && fact.bitmaskStrings.length === 0 && !validate + focus: setFocus && visible Component.onCompleted: { // We can't bind directly to fact.enumIndex since that would add an unknown value