diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-06 00:27:24 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-06 00:27:24 +0200 |
commit | 37983d97ec0eb03845f11eb03f429174acfd327b (patch) | |
tree | 9dbb5cdf8bbc463b43d38f45353b80b0f8ad7fe7 /components/mailviewer | |
parent | e98793cb59a1f29fe3b6980e0af3a48ed049024d (diff) | |
download | kube-37983d97ec0eb03845f11eb03f429174acfd327b.tar.gz kube-37983d97ec0eb03845f11eb03f429174acfd327b.zip |
A simplistic security border
Still a bit obnoxious and doesn't really convey a whole lot of
information. Consider it a stub for now
Diffstat (limited to 'components/mailviewer')
-rw-r--r-- | components/mailviewer/contents/ui/MailDataModel.qml | 33 | ||||
-rw-r--r-- | components/mailviewer/contents/ui/TextContent.qml | 7 |
2 files changed, 30 insertions, 10 deletions
diff --git a/components/mailviewer/contents/ui/MailDataModel.qml b/components/mailviewer/contents/ui/MailDataModel.qml index 99bd0dc2..46427194 100644 --- a/components/mailviewer/contents/ui/MailDataModel.qml +++ b/components/mailviewer/contents/ui/MailDataModel.qml | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | import QtQuick 2.4 | 19 | import QtQuick 2.4 |
20 | import QtQml.Models 2.2 | 20 | import QtQml.Models 2.2 |
21 | import org.kube.framework 1.0 as Kube | ||
21 | 22 | ||
22 | DelegateModel { | 23 | DelegateModel { |
23 | id: mailDataModel | 24 | id: mailDataModel |
@@ -25,16 +26,38 @@ DelegateModel { | |||
25 | 26 | ||
26 | delegate: Item { | 27 | delegate: Item { |
27 | id: partColumn | 28 | id: partColumn |
29 | |||
28 | width: parent.width | 30 | width: parent.width |
29 | height: childrenRect.height | 31 | height: childrenRect.height |
30 | Loader { | 32 | |
31 | id: partLoader | 33 | Row { |
32 | anchors { | 34 | anchors { |
33 | top: parent.top | 35 | top: parent.top |
34 | left: parent.left | 36 | left: parent.left |
37 | right: parent.right | ||
38 | } | ||
39 | height: partLoader.height | ||
40 | spacing: Kube.Units.smallSpacing | ||
41 | Rectangle { | ||
42 | id: border | ||
43 | visible: model.encrypted || model.signed | ||
44 | anchors { | ||
45 | top: parent.top | ||
46 | bottom: parent.bottom | ||
47 | } | ||
48 | width: Kube.Units.smallSpacing | ||
49 | color: Kube.Colors.positiveColor | ||
50 | opacity: 0.5 | ||
51 | } | ||
52 | |||
53 | Loader { | ||
54 | id: partLoader | ||
55 | anchors { | ||
56 | top: parent.top | ||
57 | } | ||
58 | height: item? item.contentHeight : 0 | ||
59 | width: parent.width | ||
35 | } | 60 | } |
36 | height: item? item.contentHeight : 0 | ||
37 | width: parent.width | ||
38 | } | 61 | } |
39 | Component.onCompleted: { | 62 | Component.onCompleted: { |
40 | switch (model.type) { | 63 | switch (model.type) { |
@@ -42,14 +65,12 @@ DelegateModel { | |||
42 | partLoader.setSource("TextContent.qml", | 65 | partLoader.setSource("TextContent.qml", |
43 | {"content": model.content, | 66 | {"content": model.content, |
44 | "embedded": model.embeded, | 67 | "embedded": model.embeded, |
45 | "securityLevel": model.securityLevel, | ||
46 | "type": model.type, | 68 | "type": model.type, |
47 | "debug": debug}) | 69 | "debug": debug}) |
48 | break | 70 | break |
49 | case "html": | 71 | case "html": |
50 | partLoader.setSource("HtmlContent.qml", | 72 | partLoader.setSource("HtmlContent.qml", |
51 | {"content": model.content, | 73 | {"content": model.content, |
52 | "securityLevel": model.securityLevel, | ||
53 | "debug": debug}) | 74 | "debug": debug}) |
54 | break; | 75 | break; |
55 | case "error": | 76 | case "error": |
diff --git a/components/mailviewer/contents/ui/TextContent.qml b/components/mailviewer/contents/ui/TextContent.qml index 90442b8f..f8ef7f9a 100644 --- a/components/mailviewer/contents/ui/TextContent.qml +++ b/components/mailviewer/contents/ui/TextContent.qml | |||
@@ -21,14 +21,13 @@ import QtQuick 2.7 | |||
21 | import org.kube.framework 1.0 as Kube | 21 | import org.kube.framework 1.0 as Kube |
22 | 22 | ||
23 | Item { | 23 | Item { |
24 | id: textItem | 24 | id: root |
25 | 25 | ||
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 string type | 29 | property string type |
30 | 30 | ||
31 | width: partColumn.width | ||
32 | height: textColumn.height | 31 | height: textColumn.height |
33 | 32 | ||
34 | Column { | 33 | Column { |
@@ -37,9 +36,9 @@ Item { | |||
37 | anchors { | 36 | anchors { |
38 | top: parent.top | 37 | top: parent.top |
39 | left: parent.left | 38 | left: parent.left |
39 | right: parent.right | ||
40 | } | 40 | } |
41 | 41 | ||
42 | width: parent.width | ||
43 | spacing: 5 | 42 | spacing: 5 |
44 | 43 | ||
45 | TextEdit { | 44 | TextEdit { |
@@ -59,7 +58,7 @@ Item { | |||
59 | //BEGIN debug | 58 | //BEGIN debug |
60 | Text { | 59 | Text { |
61 | width: parent.width | 60 | width: parent.width |
62 | visible: textItem.debug | 61 | visible: root.debug |
63 | text: type | 62 | text: type |
64 | } | 63 | } |
65 | //END debug | 64 | //END debug |