From 3acdf464393bdab5f5740df6739ab5f290fd1119 Mon Sep 17 00:00:00 2001 From: "Sebastian J. Wolf" Date: Fri, 18 Sep 2020 22:55:59 +0200 Subject: [PATCH] React properly on show/hide keyboard --- qml/pages/AboutPage.qml | 2 +- qml/pages/ChatPage.qml | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/qml/pages/AboutPage.qml b/qml/pages/AboutPage.qml index d7ea27c..ef4ae1c 100644 --- a/qml/pages/AboutPage.qml +++ b/qml/pages/AboutPage.qml @@ -51,7 +51,7 @@ Page { fillMode: Image.PreserveAspectFit asynchronous: true - width: 2/3 * parent.width + width: aboutPage.isPortrait ? ( 1/2 * parent.width ) : ( 1/2 * parent.height ) } diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml index c9cf9f9..6b7d85a 100644 --- a/qml/pages/ChatPage.qml +++ b/qml/pages/ChatPage.qml @@ -260,7 +260,7 @@ Page { Row { id: headerRow width: parent.width - (3 * Theme.horizontalPageMargin) - height: chatOverviewColumn.height + ( 2 * Theme.paddingLarge ) + height: chatOverviewColumn.height + Theme.paddingLarge anchors.horizontalCenter: parent.horizontalCenter spacing: Theme.paddingMedium @@ -316,6 +316,18 @@ Page { width: parent.width height: parent.height - Theme.paddingMedium - headerRow.height - ( chatPage.isChannel ? 0 : ( newMessageColumn.height + Theme.paddingMedium ) ) + property int previousHeight; + + Component.onCompleted: { + previousHeight = height; + } + + onHeightChanged: { + var deltaHeight = previousHeight - height; + chatView.contentY = chatView.contentY + deltaHeight; + previousHeight = height; + } + Timer { id: chatViewLoadingTimer interval: 100 @@ -655,7 +667,7 @@ Page { Row { id: newMessageRow width: parent.width - height: sendMessageColumn.height + ( 2 * Theme.paddingLarge ) + height: sendMessageColumn.height + Theme.paddingLarge anchors.horizontalCenter: parent.horizontalCenter Column {