From d3228a2899992370e3fb19609eb1433d02de0f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Nicole?= Date: Wed, 21 Feb 2018 21:11:01 +0100 Subject: T7024 fix: implement attachment-based forwarding Summary: Implement attachment-based forwarding. Some notes: - `loadAsDraft` was removed in favor of new enum `loadType` in QML, and callback based generic programming in C++ Reviewers: cmollekopf Tags: #kube Maniphest Tasks: T7024 Differential Revision: https://phabricator.kde.org/D10676 --- framework/qml/Icons.qml | 1 + framework/qml/MailViewer.qml | 36 ++++++++++++++++++++++++++---------- framework/qml/Messages.qml | 1 + 3 files changed, 28 insertions(+), 10 deletions(-) (limited to 'framework/qml') diff --git a/framework/qml/Icons.qml b/framework/qml/Icons.qml index 3636a192..2afe840e 100644 --- a/framework/qml/Icons.qml +++ b/framework/qml/Icons.qml @@ -41,6 +41,7 @@ Item { property string edit: "document-edit" property string edit_inverted: "document-edit-inverted" property string replyToSender: "mail-reply-sender" + property string forward: "mail-forward" property string outbox: "mail-folder-outbox" property string outbox_inverted: "mail-folder-outbox-inverted" property string copy: "edit-copy" diff --git a/framework/qml/MailViewer.qml b/framework/qml/MailViewer.qml index 1a832470..f52e694d 100644 --- a/framework/qml/MailViewer.qml +++ b/framework/qml/MailViewer.qml @@ -370,24 +370,40 @@ Rectangle { } } - Kube.IconButton { - visible: !model.trash - anchors{ + Grid { + anchors { verticalCenter: parent.verticalCenter right: parent.right rightMargin: Kube.Units.largeSpacing } - activeFocusOnTab: false + columns: 2 - iconName: model.draft ? Kube.Icons.edit : Kube.Icons.replyToSender - onClicked: { - if (model.draft) { - Kube.Fabric.postMessage(Kube.Messages.edit, {"mail": model.mail, "isDraft": model.draft}) - } else { - Kube.Fabric.postMessage(Kube.Messages.reply, {"mail": model.mail, "isDraft": model.draft}) + Kube.IconButton { + visible: !model.trash + activeFocusOnTab: false + + iconName: model.draft ? Kube.Icons.edit : Kube.Icons.replyToSender + onClicked: { + if (model.draft) { + Kube.Fabric.postMessage(Kube.Messages.edit, {"mail": model.mail}) + } else { + Kube.Fabric.postMessage(Kube.Messages.reply, {"mail": model.mail}) + } } } + + Kube.IconButton { + visible: !model.trash && !model.draft + activeFocusOnTab: false + + iconName: Kube.Icons.forward + onClicked: { + Kube.Fabric.postMessage(Kube.Messages.forward, {"mail": model.mail}) + } + } + } + } Rectangle { anchors.fill: parent diff --git a/framework/qml/Messages.qml b/framework/qml/Messages.qml index 18db51ff..9df83863 100644 --- a/framework/qml/Messages.qml +++ b/framework/qml/Messages.qml @@ -44,6 +44,7 @@ Item { property string search: "search" property string synchronize: "synchronize" property string reply: "reply" + property string forward: "forward" property string edit: "edit" property string compose: "compose" property string sendOutbox: "sendOutbox" -- cgit v1.2.3