From dd6348e1a98407b91f6758a38f42d849274866a3 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 26 Aug 2017 14:32:09 -0600 Subject: Assign a color depending on the encryption/signature state. --- components/mailviewer/contents/ui/MailDataModel.qml | 16 +++++++++++++++- components/mailviewer/contents/ui/MailPart.qml | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'components/mailviewer') 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 { width: parent.width height: childrenRect.height + function getColor(securityLevel) + { + if (securityLevel == "good") { + return Kube.Colors.positiveColor + } + if (securityLevel == "bad") { + return Kube.Colors.negativeColor + } + if (securityLevel == "notsogood") { + return Kube.Colors.warningColor + } + return Kube.Colors.lightgrey + } + Row { anchors { top: parent.top @@ -45,7 +59,7 @@ DelegateModel { bottom: parent.bottom } width: Kube.Units.smallSpacing - color: Kube.Colors.positiveColor + color: getColor(model.securityLevel) opacity: 0.5 } diff --git a/components/mailviewer/contents/ui/MailPart.qml b/components/mailviewer/contents/ui/MailPart.qml index 3dbca1d4..4fa2bd73 100644 --- a/components/mailviewer/contents/ui/MailPart.qml +++ b/components/mailviewer/contents/ui/MailPart.qml @@ -39,7 +39,7 @@ Item { left: parent.left leftMargin: Kube.Units.smallSpacing } - color: "lightgrey" + color: Kube.Colors.lightgrey height: partListView.height width: Kube.Units.smallSpacing } -- cgit v1.2.3