diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-12-30 12:32:57 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-01 11:35:39 -0800 |
commit | 1771c39dd8ae06bfc35393e2028d01c1ec4bc978 (patch) | |
tree | a6d9ccdc0307d037aac069779909c20524c89c9b | |
parent | d6456d490fe8af39e9b9255071ae3e29db7f2dc3 (diff) | |
download | subsurface-1771c39dd8ae06bfc35393e2028d01c1ec4bc978.tar.gz |
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 <dirk@hohndel.org>
-rw-r--r-- | mobile-widgets/qml/DiveDetails.qml | 2 | ||||
-rw-r--r-- | mobile-widgets/qml/DiveDetailsEdit.qml | 7 |
2 files changed, 8 insertions, 1 deletions
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 |