From 5880ba07757f85c41474d3eb6473facdcb468482 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 7 Apr 2016 12:09:39 +0200 Subject: Replace the HTML view by a tree of QML views. This allows us to do all the visual hints for the mail parts in qml, instead of HTML. --- components/package/contents/ui/MailViewer.qml | 30 ++++++++------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'components/package') diff --git a/components/package/contents/ui/MailViewer.qml b/components/package/contents/ui/MailViewer.qml index 771c6fa0..c51e2666 100644 --- a/components/package/contents/ui/MailViewer.qml +++ b/components/package/contents/ui/MailViewer.qml @@ -1,7 +1,6 @@ import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 -import QtWebKit 3.0 import org.kube.framework.domain 1.0 as KubeFramework @@ -10,29 +9,18 @@ Item { property variant message; property string html; - WebView { - id: webview + Rectangle { + id: rootRectangle anchors.fill: parent - onNavigationRequested: { - // detect URL scheme prefix, most likely an external link - var schemaRE = /^\w+:/; - if (schemaRE.test(request.url)) { - request.action = WebView.AcceptRequest; - } else { - request.action = WebView.IgnoreRequest; - // delegate request.url here + ScrollView { + id: scrollView + anchors.fill: parent + MessagePartTree { + id: topPartLoader + width: rootRectangle.width + height: topPartLoader.desiredHeight } } - onLoadingChanged: { - console.warn("Error is ", loadRequest.errorString); - console.warn("Status is ", loadRequest.status); - } - } - - onHtmlChanged: { - // console.warn("HTML is ", html); - // The file:/// argument is necessary so local icons are found - webview.loadHtml(html, "file:///"); } KubeFramework.MessageParser { -- cgit v1.2.3