diff --git a/src/qml/Toast.qml b/src/qml/Toast.qml index a4c52c7402..a39be68a8c 100644 --- a/src/qml/Toast.qml +++ b/src/qml/Toast.qml @@ -7,9 +7,17 @@ Popup { property string type: 'info' property int edgeSpacing: 52 + property real virtualKeyboardHeight: { + const top = Qt.inputMethod.keyboardRectangle.top / Screen.devicePixelRatio; + if (top > 0) { + const height = Qt.inputMethod.keyboardRectangle.height / Screen.devicePixelRatio; + return height - (top + height - mainWindow.height); + } + return 0; + } x: edgeSpacing - y: parent.height - 112 + y: mainWindow.height - 112 - virtualKeyboardHeight z: 10001 width: mainWindow.width - edgeSpacing * 2