diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-23 10:30:21 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-23 10:30:21 +0200 |
commit | e7b821c4308c6ed15daed911184980149cce38ff (patch) | |
tree | bdf19f2bc06253aa283dbb1ff56458091737cad5 /components/mailviewer | |
parent | 7f90b1ddab470a414833ffadd4fdefc2382ab6fc (diff) | |
download | kube-e7b821c4308c6ed15daed911184980149cce38ff.tar.gz kube-e7b821c4308c6ed15daed911184980149cce38ff.zip |
Always use richtext, and avoid using a browser for simple html
Diffstat (limited to 'components/mailviewer')
-rw-r--r-- | components/mailviewer/contents/ui/MailDataModel.qml | 7 | ||||
-rw-r--r-- | components/mailviewer/contents/ui/TextContent.qml | 10 |
2 files changed, 8 insertions, 9 deletions
diff --git a/components/mailviewer/contents/ui/MailDataModel.qml b/components/mailviewer/contents/ui/MailDataModel.qml index 8a42630a..f4b4e7c7 100644 --- a/components/mailviewer/contents/ui/MailDataModel.qml +++ b/components/mailviewer/contents/ui/MailDataModel.qml | |||
@@ -57,15 +57,14 @@ DelegateModel { | |||
57 | width: parent.width | 57 | width: parent.width |
58 | } | 58 | } |
59 | Component.onCompleted: { | 59 | Component.onCompleted: { |
60 | var isHtml = false | 60 | //If the content is not complex, avoid using a full browser |
61 | var forcePlain = false | 61 | var forcePlain = !model.complexHtmlContent |
62 | var partType = getPartType(model.type, model.hasModelChildren, forcePlain); | 62 | var partType = getPartType(model.type, model.hasModelChildren, forcePlain); |
63 | 63 | ||
64 | switch (partType) { | 64 | switch (partType) { |
65 | case "plain": | 65 | case "plain": |
66 | partLoader.setSource("TextContent.qml", | 66 | partLoader.setSource("TextContent.qml", |
67 | {"isHtml": isHtml, | 67 | {"content": model.content, |
68 | "content": model.content, | ||
69 | "embedded": model.embeded, | 68 | "embedded": model.embeded, |
70 | "type": model.type, | 69 | "type": model.type, |
71 | "debug": debug}) | 70 | "debug": debug}) |
diff --git a/components/mailviewer/contents/ui/TextContent.qml b/components/mailviewer/contents/ui/TextContent.qml index 63573d81..90442b8f 100644 --- a/components/mailviewer/contents/ui/TextContent.qml +++ b/components/mailviewer/contents/ui/TextContent.qml | |||
@@ -26,7 +26,6 @@ Item { | |||
26 | property string content | 26 | property string content |
27 | property bool debug: true | 27 | property bool debug: true |
28 | property bool embedded: true | 28 | property bool embedded: true |
29 | property bool isHtml: true | ||
30 | property string type | 29 | property string type |
31 | 30 | ||
32 | width: partColumn.width | 31 | width: partColumn.width |
@@ -43,17 +42,18 @@ Item { | |||
43 | width: parent.width | 42 | width: parent.width |
44 | spacing: 5 | 43 | spacing: 5 |
45 | 44 | ||
46 | TextEdit { | 45 | TextEdit { |
47 | width: parent.width | 46 | width: parent.width |
48 | 47 | ||
49 | readOnly: true | 48 | readOnly: true |
50 | selectByMouse: true | 49 | selectByMouse: true |
51 | 50 | ||
52 | text: content | 51 | text: content |
53 | wrapMode: Text.WordWrap | 52 | wrapMode: TextEdit.Wrap |
54 | textFormat: textItem.isHtml ? Text.RichText : Text.PlainText | 53 | textFormat: Text.RichText |
55 | 54 | ||
56 | color: embedded ? Kube.Colors.diabledTextColor : Kube.Colors.textColor | 55 | color: embedded ? Kube.Colors.disabledTextColor : Kube.Colors.textColor |
56 | onLinkActivated: Qt.openUrlExternally(link) | ||
57 | } | 57 | } |
58 | 58 | ||
59 | //BEGIN debug | 59 | //BEGIN debug |