diff options
-rw-r--r-- | components/CMakeLists.txt | 2 | ||||
-rw-r--r-- | components/mailviewer/qml/MailViewer.qml | 60 | ||||
-rw-r--r-- | components/mailviewer/qml/qmldir | 3 | ||||
-rw-r--r-- | components/package/contents/ui/MailViewer.qml | 10 |
4 files changed, 69 insertions, 6 deletions
diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 66e27822..30a9d09c 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt | |||
@@ -24,7 +24,7 @@ find_package(KF5 REQUIRED COMPONENTS Package) | |||
24 | 24 | ||
25 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/components) | 25 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/components) |
26 | install(DIRECTORY package/contents/ui/ DESTINATION ${QML_INSTALL_DIR}/org/kube/components) | 26 | install(DIRECTORY package/contents/ui/ DESTINATION ${QML_INSTALL_DIR}/org/kube/components) |
27 | install(DIRECTORY mailviewer/qml/ DESTINATION ${QML_INSTALL_DIR}/org/kube/components) | 27 | install(DIRECTORY mailviewer/qml/ DESTINATION ${QML_INSTALL_DIR}/org/kube/mailviewer) |
28 | 28 | ||
29 | include(${CMAKE_SOURCE_DIR}/KF5KirigamiMacros.cmake) | 29 | include(${CMAKE_SOURCE_DIR}/KF5KirigamiMacros.cmake) |
30 | kirigami_package_breeze_icons(ICONS applications-graphics view-list-icons folder-sync view-list-details configure document-edit dialog-cancel document-decrypt mail-reply-sender bookmarks folder) | 30 | kirigami_package_breeze_icons(ICONS applications-graphics view-list-icons folder-sync view-list-details configure document-edit dialog-cancel document-decrypt mail-reply-sender bookmarks folder) |
diff --git a/components/mailviewer/qml/MailViewer.qml b/components/mailviewer/qml/MailViewer.qml new file mode 100644 index 00000000..f5714e25 --- /dev/null +++ b/components/mailviewer/qml/MailViewer.qml | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation; either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License along | ||
15 | with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | import QtQuick 2.4 | ||
20 | |||
21 | Item { | ||
22 | id: mailviewer | ||
23 | height: mainColumn.height + 50 | ||
24 | width: parent.width * 0.9 | ||
25 | |||
26 | Column { | ||
27 | id: mainColumn | ||
28 | anchors { | ||
29 | top: parent.top | ||
30 | left: parent.left | ||
31 | right: parent.right | ||
32 | margins: 20 | ||
33 | } | ||
34 | spacing: 10 | ||
35 | width: parent.width - 50 | ||
36 | |||
37 | Repeater { | ||
38 | model: messageParser.newTree | ||
39 | |||
40 | delegate: Column { | ||
41 | id: delegateRoot | ||
42 | |||
43 | width: mainColumn.width | ||
44 | |||
45 | Loader { | ||
46 | id: loader | ||
47 | } | ||
48 | |||
49 | Component.onCompleted: { | ||
50 | switch (model.type) { | ||
51 | case "AlternativePart": | ||
52 | case "SinglePart": | ||
53 | loader.source = "MailPart.qml"; | ||
54 | break; | ||
55 | } | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | } | ||
diff --git a/components/mailviewer/qml/qmldir b/components/mailviewer/qml/qmldir new file mode 100644 index 00000000..0d87b779 --- /dev/null +++ b/components/mailviewer/qml/qmldir | |||
@@ -0,0 +1,3 @@ | |||
1 | module org.kube.mailviewer | ||
2 | |||
3 | MailViewer 1.0 MailViewer.qml | ||
diff --git a/components/package/contents/ui/MailViewer.qml b/components/package/contents/ui/MailViewer.qml index 347f30de..02d84728 100644 --- a/components/package/contents/ui/MailViewer.qml +++ b/components/package/contents/ui/MailViewer.qml | |||
@@ -22,13 +22,14 @@ import QtQuick.Controls 1.4 | |||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 |
23 | 23 | ||
24 | import org.kube.framework.domain 1.0 as KubeFramework | 24 | import org.kube.framework.domain 1.0 as KubeFramework |
25 | import org.kube.mailviewer 1.0 as MV | ||
25 | 26 | ||
26 | Item { | 27 | Item { |
27 | id: root | 28 | id: root |
28 | property variant message; | 29 | property variant message; |
29 | property string html; | 30 | property string html; |
30 | property bool enablePartTreeView : true; | 31 | property bool enablePartTreeView : true; |
31 | property int desiredHeight: enablePartTreeView ? topPartLoader.height + dummyApp.height + mailStructure.height + 50 : topPartLoader.height + dummyApp.height + 50; | 32 | property int desiredHeight: enablePartTreeView ? topPartLoader.height + newMailViewer.height + mailStructure.height + 50 : topPartLoader.height + newMailViewer.height + 50; |
32 | 33 | ||
33 | Rectangle { | 34 | Rectangle { |
34 | id: rootRectangle | 35 | id: rootRectangle |
@@ -40,14 +41,13 @@ Item { | |||
40 | anchors.margins: 0 | 41 | anchors.margins: 0 |
41 | verticalScrollBarPolicy: Qt.ScrollBarAlwaysOff | 42 | verticalScrollBarPolicy: Qt.ScrollBarAlwaysOff |
42 | Column { | 43 | Column { |
43 | spacing:2 | 44 | spacing: 2 |
44 | Text { | 45 | Text { |
45 | text: "New Mailviewer:" | 46 | text: "New Mailviewer:" |
46 | color: "blue" | 47 | color: "blue" |
47 | } | 48 | } |
48 | DummyApp { | 49 | MV.MailViewer { |
49 | id: dummyApp | 50 | id: newMailViewer |
50 | height: 800 | ||
51 | width: rootRectangle.width | 51 | width: rootRectangle.width |
52 | } | 52 | } |
53 | Text { | 53 | Text { |