From a1e550a260f5c3e913631589fc5e54b064d8f0b0 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 1 Dec 2019 11:58:10 +0100 Subject: [PATCH 1/2] Work around QtVirtualKeyboard layering issues https://bugreports.qt.io/browse/QTBUG-56918 --- nymea-app/ui/Nymea.qml | 6 ++++++ nymea-app/ui/devicepages/DevicePageBase.qml | 3 +++ nymea-app/ui/thingconfiguration/ConfigureThingPage.qml | 3 +++ 3 files changed, 12 insertions(+) diff --git a/nymea-app/ui/Nymea.qml b/nymea-app/ui/Nymea.qml index 1d5365d7..229f4eda 100644 --- a/nymea-app/ui/Nymea.qml +++ b/nymea-app/ui/Nymea.qml @@ -415,8 +415,14 @@ ApplicationWindow { } + // NOTE: If using a Dialog, make sure closePolicy does not contain Dialo.CloseOnPressOutside + // or the virtual keyboard will close when pressing it... + + // https://bugreports.qt.io/browse/QTBUG-56918 KeyboardLoader { id: keyboardRect + parent: app.overlay + z: 1 anchors { left: parent.left; bottom: parent.bottom; right: parent.right } } } diff --git a/nymea-app/ui/devicepages/DevicePageBase.qml b/nymea-app/ui/devicepages/DevicePageBase.qml index 1c2d34ad..62e3990c 100644 --- a/nymea-app/ui/devicepages/DevicePageBase.qml +++ b/nymea-app/ui/devicepages/DevicePageBase.qml @@ -119,6 +119,9 @@ Page { MeaDialog { title: qsTr("Groups for %1").arg(root.device.name) headerIcon: "../images/view-grid-symbolic.svg" + // NOTE: If CloseOnPressOutside is active (default) it will break the QtVirtualKeyboard + // https://bugreports.qt.io/browse/QTBUG-56918 + closePolicy: Popup.CloseOnEscape RowLayout { Layout.leftMargin: app.margins diff --git a/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml b/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml index 56167421..edd526c9 100644 --- a/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml +++ b/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml @@ -206,6 +206,9 @@ Page { y: app.margins standardButtons: Dialog.Ok | Dialog.Cancel + // NOTE: If CloseOnPressOutside is active (default) it will break the QtVirtualKeyboard + // https://bugreports.qt.io/browse/QTBUG-56918 + closePolicy: Popup.CloseOnEscape TextField { id: textField From 62e87c1f538db1a9654e8548027563c06b0dbf69 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 1 Dec 2019 12:45:26 +0100 Subject: [PATCH 2/2] move mousearea into dialog --- nymea-app/ui/Nymea.qml | 2 +- nymea-app/ui/components/MeaDialog.qml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/nymea-app/ui/Nymea.qml b/nymea-app/ui/Nymea.qml index 229f4eda..5733dc37 100644 --- a/nymea-app/ui/Nymea.qml +++ b/nymea-app/ui/Nymea.qml @@ -415,7 +415,7 @@ ApplicationWindow { } - // NOTE: If using a Dialog, make sure closePolicy does not contain Dialo.CloseOnPressOutside + // NOTE: If using a Dialog, make sure closePolicy does not contain Dialog.CloseOnPressOutside // or the virtual keyboard will close when pressing it... // https://bugreports.qt.io/browse/QTBUG-56918 diff --git a/nymea-app/ui/components/MeaDialog.qml b/nymea-app/ui/components/MeaDialog.qml index 00c21b2d..a11016ec 100644 --- a/nymea-app/ui/components/MeaDialog.qml +++ b/nymea-app/ui/components/MeaDialog.qml @@ -14,6 +14,13 @@ Dialog { standardButtons: Dialog.Ok + MouseArea { + parent: app.overlay + anchors.fill: parent + z: -1 + onPressed: mouse.accepted = true + } + header: Item { implicitHeight: headerRow.height + app.margins * 2 implicitWidth: parent.width