From adb706a7e9e09c234b373d8ecc32f2eefc9f7bc0 Mon Sep 17 00:00:00 2001 From: Malte E Date: Tue, 22 Mar 2022 20:33:14 +0100 Subject: [PATCH] add height of keyboard rectangle for height calculations of some messages --- resources/qml/TimelineView.qml | 1 + resources/qml/delegates/ImageMessage.qml | 2 +- resources/qml/delegates/PlayableMediaMessage.qml | 2 +- resources/qml/delegates/TextMessage.qml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index c4820077..9445e458 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -23,6 +23,7 @@ Item { property var room: null property var roomPreview: null property bool showBackButton: false + property int fullHeight: height+Qt.inputMethod.keyboardRectangle.height Label { visible: !room && !TimelineManager.isInitialSync && (!roomPreview || !roomPreview.roomid) diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml index 2ee8da7f..566302ab 100644 --- a/resources/qml/delegates/ImageMessage.qml +++ b/resources/qml/delegates/ImageMessage.qml @@ -21,7 +21,7 @@ Item { property int tempWidth: originalWidth < 1? 400: originalWidth - implicitWidth: Math.round(tempWidth*Math.min((timelineView.height/divisor)/(tempWidth*proportionalHeight), 1)) + implicitWidth: Math.round(tempWidth*Math.min((timelineView.fullHeight/divisor)/(tempWidth*proportionalHeight), 1)) width: Math.min(parent.width,implicitWidth) height: width*proportionalHeight diff --git a/resources/qml/delegates/PlayableMediaMessage.qml b/resources/qml/delegates/PlayableMediaMessage.qml index 4828843c..4a23e259 100644 --- a/resources/qml/delegates/PlayableMediaMessage.qml +++ b/resources/qml/delegates/PlayableMediaMessage.qml @@ -25,7 +25,7 @@ Item { required property string filesize property double divisor: isReply ? 4 : 2 property int tempWidth: originalWidth < 1? 400: originalWidth - implicitWidth: type == MtxEvent.VideoMessage ? Math.round(tempWidth*Math.min((timelineView.height/divisor)/(tempWidth*proportionalHeight), 1)) : 500 + implicitWidth: type == MtxEvent.VideoMessage ? Math.round(tempWidth*Math.min((timelineView.fullHeight/divisor)/(tempWidth*proportionalHeight), 1)) : 500 width: Math.min(parent.width, implicitWidth) height: (type == MtxEvent.VideoMessage ? width*proportionalHeight : 80) + fileInfoLabel.height implicitHeight: height diff --git a/resources/qml/delegates/TextMessage.qml b/resources/qml/delegates/TextMessage.qml index 73411ab6..bc42274a 100644 --- a/resources/qml/delegates/TextMessage.qml +++ b/resources/qml/delegates/TextMessage.qml @@ -36,7 +36,7 @@ MatrixText { " + formatted.replace(/
/g, "
").replace(//g, "").replace(/<\/del>/g, "").replace(//g, "").replace(/<\/strike>/g, "")
     width: parent.width
-    height: isReply ? Math.round(Math.min(timelineView.height / 8, implicitHeight)) : implicitHeight
+    height: isReply ? Math.round(Math.min(timelineView.fullHeight / 8, implicitHeight)) : implicitHeight
     clip: isReply
     selectByMouse: !Settings.mobileMode && !isReply
     font.pointSize: (Settings.enlargeEmojiOnlyMessages && isOnlyEmoji > 0 && isOnlyEmoji < 4) ? Settings.fontSize * 3 : Settings.fontSize