From 8bbf98eb13eeb60e98bc5ff9e116eb35b0e2c081 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 1 Jul 2018 17:56:32 +0200 Subject: Prepared auto load images --- components/mailviewer/qml/ErrorPart.qml | 1 + components/mailviewer/qml/HtmlContent.qml | 4 +++- components/mailviewer/qml/MailDataModel.qml | 7 +++++++ components/mailviewer/qml/MailPart.qml | 1 + components/mailviewer/qml/MailViewer.qml | 1 + components/mailviewer/qml/TextContent.qml | 1 + framework/qml/ConversationView.qml | 2 ++ framework/qml/MailViewer.qml | 1 + 8 files changed, 17 insertions(+), 1 deletion(-) diff --git a/components/mailviewer/qml/ErrorPart.qml b/components/mailviewer/qml/ErrorPart.qml index 54332375..1a84ad0b 100644 --- a/components/mailviewer/qml/ErrorPart.qml +++ b/components/mailviewer/qml/ErrorPart.qml @@ -24,6 +24,7 @@ Item { property variant errorType property string errorString property string searchString + property bool autoLoadImages: false height: partListView.height width: parent.width diff --git a/components/mailviewer/qml/HtmlContent.qml b/components/mailviewer/qml/HtmlContent.qml index 7a904152..aa9c5e9a 100644 --- a/components/mailviewer/qml/HtmlContent.qml +++ b/components/mailviewer/qml/HtmlContent.qml @@ -27,6 +27,8 @@ Item { //We have to give it a minimum size so the html content starts to expand property int contentHeight: 10; property string searchString + property bool autoLoadImages: false + onSearchStringChanged: { htmlView.findText(searchString) } @@ -75,7 +77,7 @@ Item { fullScreenSupportEnabled: false errorPageEnabled: false //defaultTextEncoding: ??? - autoLoadImages: true + autoLoadImages: root.autoLoadImages autoLoadIconsForPage: false accelerated2dCanvasEnabled: false //The webview should not steal focus diff --git a/components/mailviewer/qml/MailDataModel.qml b/components/mailviewer/qml/MailDataModel.qml index fdc3ce22..099548bf 100644 --- a/components/mailviewer/qml/MailDataModel.qml +++ b/components/mailviewer/qml/MailDataModel.qml @@ -24,6 +24,7 @@ DelegateModel { id: root property string searchString: "" + property bool autoLoadImages: false delegate: Item { id: partColumn @@ -132,6 +133,12 @@ DelegateModel { value: root.searchString when: partLoader.status == Loader.Ready } + Binding { + target: partLoader.item + property: "autoLoadImages" + value: root.autoLoadImages + when: partLoader.status == Loader.Ready + } } Component.onCompleted: { switch (model.type) { diff --git a/components/mailviewer/qml/MailPart.qml b/components/mailviewer/qml/MailPart.qml index 9a9e1040..15042abf 100644 --- a/components/mailviewer/qml/MailPart.qml +++ b/components/mailviewer/qml/MailPart.qml @@ -25,6 +25,7 @@ Item { property alias rootIndex: visualModel.rootIndex property alias model: visualModel.model property alias searchString: visualModel.searchString + property alias autoLoadImages: visualModel.autoLoadImages property variant sender property variant date height: childrenRect.height diff --git a/components/mailviewer/qml/MailViewer.qml b/components/mailviewer/qml/MailViewer.qml index faf3bc61..6210a345 100644 --- a/components/mailviewer/qml/MailViewer.qml +++ b/components/mailviewer/qml/MailViewer.qml @@ -23,6 +23,7 @@ Item { property alias rootIndex: visualModel.rootIndex property alias model: visualModel.model property alias searchString: visualModel.searchString + property alias autoLoadImages: visualModel.autoLoadImages height: partListView.height MailDataModel { diff --git a/components/mailviewer/qml/TextContent.qml b/components/mailviewer/qml/TextContent.qml index e8a7f6d4..8c246e00 100644 --- a/components/mailviewer/qml/TextContent.qml +++ b/components/mailviewer/qml/TextContent.qml @@ -27,6 +27,7 @@ Item { property string content property bool embedded: true property string type + property bool autoLoadImages: false property string searchString property int contentHeight: textEdit.height diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml index 4df7dfa0..e1e93b66 100644 --- a/framework/qml/ConversationView.qml +++ b/framework/qml/ConversationView.qml @@ -32,6 +32,7 @@ FocusScope { property bool hideTrash: true; property bool hideNonTrash: false; property string searchString: "" + property bool autoLoadImages: true Kube.Listener { filter: Kube.Messages.searchString @@ -143,6 +144,7 @@ FocusScope { incomplete: model.incomplete current: delegateRoot.isCurrentItem searchString: root.searchString + autoLoadImages: root.autoLoadImages } } diff --git a/framework/qml/MailViewer.qml b/framework/qml/MailViewer.qml index d18ed8e6..a43c99e9 100644 --- a/framework/qml/MailViewer.qml +++ b/framework/qml/MailViewer.qml @@ -43,6 +43,7 @@ Rectangle { property bool current: false; property bool unread; property alias searchString: mailViewer.searchString + property alias autoLoadImages: mailViewer.autoLoadImages implicitHeight: header.height + attachments.height + body.height + incompleteBody.height + footer.height + Kube.Units.largeSpacing -- cgit v1.2.3