summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/package/contents/ui/SingleMailView.qml11
-rw-r--r--framework/domain/maillistmodel.cpp1
2 files changed, 8 insertions, 4 deletions
diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml
index c2565cf1..b44659f9 100644
--- a/components/package/contents/ui/SingleMailView.qml
+++ b/components/package/contents/ui/SingleMailView.qml
@@ -358,15 +358,17 @@ Item {
358 mail: model.mail 358 mail: model.mail
359 } 359 }
360 360
361 text: "Delete Mail" 361 text: model.trash ? qsTr("Delete Mail") : qsTr("Move to trash")
362 color: Kirigami.Theme.textColor 362 color: Kirigami.Theme.textColor
363 opacity: 0.5 363 opacity: 0.5
364 enabled: mailController.moveToTrashAction.enabled 364 enabled: model.trash ? mailController.removeAction.enabled : mailController.moveToTrashAction.enabled
365 MouseArea { 365 MouseArea {
366 anchors.fill: parent 366 anchors.fill: parent
367 enabled: mailController.moveToTrashAction.enabled 367 enabled: parent.enabled
368 onClicked: { 368 onClicked: {
369 if (mailController.moveToTrashAction.enabled) { 369 if (model.trash) {
370 mailController.removeAction.execute();
371 } else {
370 mailController.moveToTrashAction.execute(); 372 mailController.moveToTrashAction.execute();
371 } 373 }
372 } 374 }
@@ -374,6 +376,7 @@ Item {
374 } 376 }
375 377
376 Controls1.ToolButton { 378 Controls1.ToolButton {
379 visible: !model.trash
377 anchors{ 380 anchors{
378 verticalCenter: parent.verticalCenter 381 verticalCenter: parent.verticalCenter
379 right: parent.right 382 right: parent.right
diff --git a/framework/domain/maillistmodel.cpp b/framework/domain/maillistmodel.cpp
index 950a2b8d..0e76e0a8 100644
--- a/framework/domain/maillistmodel.cpp
+++ b/framework/domain/maillistmodel.cpp
@@ -51,6 +51,7 @@ QHash< int, QByteArray > MailListModel::roleNames() const
51 roles[Unread] = "unread"; 51 roles[Unread] = "unread";
52 roles[Important] = "important"; 52 roles[Important] = "important";
53 roles[Draft] = "draft"; 53 roles[Draft] = "draft";
54 roles[Trash] = "trash";
54 roles[Id] = "id"; 55 roles[Id] = "id";
55 roles[MimeMessage] = "mimeMessage"; 56 roles[MimeMessage] = "mimeMessage";
56 roles[DomainObject] = "domainObject"; 57 roles[DomainObject] = "domainObject";