From adb706a7e9e09c234b373d8ecc32f2eefc9f7bc0 Mon Sep 17 00:00:00 2001 From: Malte E Date: Tue, 22 Mar 2022 20:33:14 +0100 Subject: [PATCH 1/3] 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 c48200770..9445e4586 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 2ee8da7fb..566302ab9 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 4828843cc..4a23e259e 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 73411ab60..bc42274ab 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

From d6df5f626b58e4484626c7b5bf7b3db6c1f8e533 Mon Sep 17 00:00:00 2001
From: Malte E 
Date: Tue, 22 Mar 2022 20:36:11 +0100
Subject: [PATCH 2/3] bubbles no longer WIP

---
 src/UserSettingsPage.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp
index 636bf75f8..a2b198baa 100644
--- a/src/UserSettingsPage.cpp
+++ b/src/UserSettingsPage.cpp
@@ -1131,8 +1131,7 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
               "Allow using markdown in messages.\nWhen disabled, all messages are sent as a plain "
               "text.");
         case Bubbles:
-            return tr(
-              "Messages get a bubble background. This also triggers some layout changes (WIP).");
+            return tr("Messages get a bubble background. This also triggers some layout changes.");
         case SmallAvatars:
             return tr("Avatars are resized to fit above the message.");
         case AnimateImagesOnHover:

From 59e42a7551b7b77d15e855c0463c49b8d55f9f25 Mon Sep 17 00:00:00 2001
From: Malte E 
Date: Wed, 23 Mar 2022 08:09:48 +0100
Subject: [PATCH 3/3] set height only when \!Qt.inputMethod.visible

---
 resources/qml/TimelineView.qml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 9445e4586..59d09fc74 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -23,7 +23,15 @@ Item {
     property var room: null
     property var roomPreview: null
     property bool showBackButton: false
-    property int fullHeight: height+Qt.inputMethod.keyboardRectangle.height
+    property int fullHeight
+
+    Component.onCompleted: {
+        fullHeight = height
+    }
+    onHeightChanged: {
+        if(!Qt.inputMethod.visible)
+            fullHeight = height
+    }
 
     Label {
         visible: !room && !TimelineManager.isInitialSync && (!roomPreview || !roomPreview.roomid)