summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-30 09:24:19 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-31 08:42:20 -0700
commit49dc8b9065af8e549260650f5d3638ebaf82e1aa (patch)
treed77f6c25d207aa34e4c766737016e32db9804772 /mobile-widgets/qml
parent085b5ff0dbe34f355dd8012e8a76c4d6e9aa0aec (diff)
downloadsubsurface-49dc8b9065af8e549260650f5d3638ebaf82e1aa.tar.gz
mobile/dive-details: don't show virtual keyboard in dive view mode
At least in 4.9.3.1258/3.0.1 I was able to reproduce a situation where I edit one dive, go back to the dive list, then tap on a different dive and then the keyboard pops up, obscuring a big chunk of the screen. This tries to make sure the keyboard isn't shown in dive view mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r--mobile-widgets/qml/DiveDetails.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml
index 4636e5ee0..b102d7206 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -197,6 +197,23 @@ Kirigami.Page {
}
]
+ Component.onCompleted: {
+ // when we first create this page, we are in "view" mode and shouldn't show
+ // a virtual keyboard. This should be unnecessary, but in some circumstances,
+ // when the user editied a dive, went back to the dive list, and then tried to
+ // view a different dive, the Android keyboard would pop up
+ Qt.inputMethod.hide()
+ }
+
+ onHeightChanged: {
+ // even with the explicit attempt to hide the keyboard above, it STILL sometimes
+ // pops up when first showing a dive. So let's get more aggressive
+ // QML doesn't let me trigger this based on the visible property of the inputMethod,
+ // but when it becomes visible, the height of the page changes, so let's use that
+ if (Qt.inputMethod.visible && state === "view")
+ Qt.inputMethod.hide()
+ }
+
property QtObject deleteAction: Kirigami.Action {
text: qsTr("Delete dive")
icon {