From fac0f64d4b4f46b002dc9826fe11a3edeab9e7d2 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 2 Jan 2017 12:05:35 +0100 Subject: Reply and edit draft action. --- components/package/contents/ui/SingleMailView.qml | 32 ++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'components/package') diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml index 5576391d..c2565cf1 100644 --- a/components/package/contents/ui/SingleMailView.qml +++ b/components/package/contents/ui/SingleMailView.qml @@ -25,6 +25,7 @@ import org.kde.kirigami 1.0 as Kirigami import QtQml 2.2 as QtQml import org.kube.framework.domain 1.0 as KubeFramework +import org.kube.framework.actions 1.0 as KubeAction Item { id: root @@ -346,7 +347,6 @@ Item { width: parent.width Text { - anchors{ verticalCenter: parent.verticalCenter left: parent.left @@ -380,8 +380,34 @@ Item { rightMargin: Kirigami.Units.gridUnit } - iconName: "mail-reply-sender" - //TODO add text + KubeAction.Context { + id: mailcontext + property variant mail + property bool isDraft + mail: model.mail + isDraft: model.draft + } + + KubeAction.Action { + id: replyAction + actionId: "org.kde.kube.actions.reply" + context: maillistcontext + } + + KubeAction.Action { + id: editAction + actionId: "org.kde.kube.actions.edit" + context: maillistcontext + } + + iconName: model.draft ? "document-edit" : "mail-reply-sender" + onClicked: { + if (model.draft) { + editAction.execute() + } else { + replyAction.execute() + } + } } } } -- cgit v1.2.3