From 46486a878310df55b686b8fbc2b6aaf35d613da7 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 23 Feb 2018 09:32:04 +0100 Subject: Demonstrate reflow problems ...and cleanup the sizes of the text/html part a bit. Html content with a
 tag, such as inserted by an apple mail reply,
is not reflowed in the TextEdit (it is in the WebEngineView).
And that causes the text edit to run off the side of the conversation
view.
---
 components/mailviewer/qml/HtmlContent.qml |  2 --
 components/mailviewer/qml/TextContent.qml |  2 +-
 tests/teststore.cpp                       |  2 +-
 views/conversation/main.qml               | 17 +++++++++++++++++
 4 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/components/mailviewer/qml/HtmlContent.qml b/components/mailviewer/qml/HtmlContent.qml
index 3ac1bb38..f0249a01 100644
--- a/components/mailviewer/qml/HtmlContent.qml
+++ b/components/mailviewer/qml/HtmlContent.qml
@@ -28,8 +28,6 @@ Item {
     //We have to give it a minimum size so the html content starts to expand
     property int contentHeight: 10;
 
-    height: contentHeight
-    width: partColumn.width
 
     WebEngineView {
         id: htmlView
diff --git a/components/mailviewer/qml/TextContent.qml b/components/mailviewer/qml/TextContent.qml
index 5d8dbc90..316786ef 100644
--- a/components/mailviewer/qml/TextContent.qml
+++ b/components/mailviewer/qml/TextContent.qml
@@ -27,7 +27,7 @@ Item {
     property bool embedded: true
     property string type
 
-    height: textEdit.height
+    property int contentHeight: textEdit.height
 
     TextEdit {
         id: textEdit
diff --git a/tests/teststore.cpp b/tests/teststore.cpp
index 6dbe5622..e5a3ea88 100644
--- a/tests/teststore.cpp
+++ b/tests/teststore.cpp
@@ -73,7 +73,7 @@ static void createMail(const QVariantMap &object, const QByteArray &folder = {})
             mb,
             object["subject"].toString(),
             object["body"].toString(),
-            {},
+            object["bodyIsHtml"].toBool(),
             {},
             {},
             {});
diff --git a/views/conversation/main.qml b/views/conversation/main.qml
index 9e17a0b6..686aeecb 100644
--- a/views/conversation/main.qml
+++ b/views/conversation/main.qml
@@ -100,6 +100,23 @@ ApplicationWindow {
                             to: ["öüä@example.org"],
                             unread: true
                         },
+                        {
+                            resource: "resource1",
+                            date: "2017-07-20T17:47:29",
+                            subject: "PlainLongLine",
+                            body: "Hi Mélanie,\n\nI'm sorry to start this on such late notice, but we'd like to get Foo and boo to woo next week, because the following weeks are unfortunately not possible for us.\n",
+                            to: ["to@example.org"],
+                            unread: true
+                        },
+                        {
+                            resource: "resource1",
+                            date: "2017-07-20T17:46:29",
+                            subject: "HTMLLongLine",
+                            body: "
Hi Mélanie,\n\nI'm sorry to start this on such late notice, but we'd like to get Foo and boo to woo next week, because the following weeks are unfortunately not possible for us.\n
",
+                            bodyIsHtml: true,
+                            to: ["to@example.org"],
+                            unread: true
+                        },
                     ]
                 }],
         }
-- 
cgit v1.2.3