diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-08-26 14:32:09 -0600 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-08-26 14:32:09 -0600 |
commit | dd6348e1a98407b91f6758a38f42d849274866a3 (patch) | |
tree | 46770bfdfd92e92f53f3c95f4583a30d7f56134f /components/mailviewer/contents/ui/MailDataModel.qml | |
parent | 66b8dcd5b49c63d0994dacb198972277d3d5063a (diff) | |
download | kube-dd6348e1a98407b91f6758a38f42d849274866a3.tar.gz kube-dd6348e1a98407b91f6758a38f42d849274866a3.zip |
Assign a color depending on the encryption/signature state.
Diffstat (limited to 'components/mailviewer/contents/ui/MailDataModel.qml')
-rw-r--r-- | components/mailviewer/contents/ui/MailDataModel.qml | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/components/mailviewer/contents/ui/MailDataModel.qml b/components/mailviewer/contents/ui/MailDataModel.qml index 0f64972c..bc2fdc58 100644 --- a/components/mailviewer/contents/ui/MailDataModel.qml +++ b/components/mailviewer/contents/ui/MailDataModel.qml | |||
@@ -29,6 +29,20 @@ DelegateModel { | |||
29 | width: parent.width | 29 | width: parent.width |
30 | height: childrenRect.height | 30 | height: childrenRect.height |
31 | 31 | ||
32 | function getColor(securityLevel) | ||
33 | { | ||
34 | if (securityLevel == "good") { | ||
35 | return Kube.Colors.positiveColor | ||
36 | } | ||
37 | if (securityLevel == "bad") { | ||
38 | return Kube.Colors.negativeColor | ||
39 | } | ||
40 | if (securityLevel == "notsogood") { | ||
41 | return Kube.Colors.warningColor | ||
42 | } | ||
43 | return Kube.Colors.lightgrey | ||
44 | } | ||
45 | |||
32 | Row { | 46 | Row { |
33 | anchors { | 47 | anchors { |
34 | top: parent.top | 48 | top: parent.top |
@@ -45,7 +59,7 @@ DelegateModel { | |||
45 | bottom: parent.bottom | 59 | bottom: parent.bottom |
46 | } | 60 | } |
47 | width: Kube.Units.smallSpacing | 61 | width: Kube.Units.smallSpacing |
48 | color: Kube.Colors.positiveColor | 62 | color: getColor(model.securityLevel) |
49 | opacity: 0.5 | 63 | opacity: 0.5 |
50 | } | 64 | } |
51 | 65 | ||