From 1771c39dd8ae06bfc35393e2028d01c1ec4bc978 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 30 Dec 2020 12:32:57 -0800 Subject: mobile/UI: don't show virtual keyboard when starting dive edit When we start editing a dive the OS will open the virtual keyboard if any of the input fields have focus (which they might get when we set their content). The explicit closing of the keyboard might be overkill, but also doesn't appear to hurt. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveDetails.qml | 2 +- mobile-widgets/qml/DiveDetailsEdit.qml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index 859387ae0..86b069444 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -382,7 +382,7 @@ Kirigami.Page { cylinderIndex4 = modelData.cylinderList.indexOf(usedCyl[4]) rating = modelData.rating visibility = modelData.viz - + detailsEdit.focusReset() diveDetailsPage.state = "edit" } diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml index d605d2919..2fddff291 100644 --- a/mobile-widgets/qml/DiveDetailsEdit.qml +++ b/mobile-widgets/qml/DiveDetailsEdit.qml @@ -48,6 +48,13 @@ Item { property int visibility property var usedCyl: [] + function focusReset() { + // set the focus explicitlt (to steal from any other field), then unset + editArea.focus = true + editArea.focus = false + Qt.inputMethod.hide() + } + function clearDetailsEdit() { detailsEdit.dive_id = 0 detailsEdit.number = 0 -- cgit v1.2.3-70-g09d2