Skip to content

Commit

Permalink
Insure that QField toasts appear above the virtual keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Sep 19, 2024
1 parent 4c91765 commit 2bdafb4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/qml/Toast.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2bdafb4

Please sign in to comment.