aboutsummaryrefslogtreecommitdiff
path: root/qml
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2021-03-01 00:24:46 +0300
committerlink2xt <link2xt@testrun.org>2021-03-01 00:24:46 +0300
commitd9bc25803d66915a45288787a3b90b1119db696e (patch)
tree1b3aa17bb70cb56df2b6fb5f61fd178226c7e832 /qml
parent88d351d4a271fa13f5ca43be01ab14267f04366a (diff)
downloadkdeltachat-d9bc25803d66915a45288787a3b90b1119db696e.tar.gz
kdeltachat-d9bc25803d66915a45288787a3b90b1119db696e.zip
chatlist: pin, unpin, archive and delete chats
Diffstat (limited to 'qml')
-rw-r--r--qml/ChatlistPage.qml35
1 files changed, 35 insertions, 0 deletions
diff --git a/qml/ChatlistPage.qml b/qml/ChatlistPage.qml
index a025015..7b7aeff 100644
--- a/qml/ChatlistPage.qml
+++ b/qml/ChatlistPage.qml
@@ -140,6 +140,41 @@ Kirigami.Page {
visible: model.freshMsgCnt > 0
verticalAlignment: Text.AlignVCenter
}
+
+ MouseArea {
+ anchors.fill: parent
+
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ onClicked: {
+ if (mouse.button === Qt.RightButton)
+ contextMenu.popup()
+ }
+ onPressAndHold: {
+ if (mouse.source === Qt.MouseEventNotSynthesized)
+ contextMenu.popup()
+ }
+
+ Menu {
+ id: contextMenu
+
+ Action {
+ text: "Pin chat"
+ onTriggered: chatlistPage.context.setChatVisibility(model.chatId, 2)
+ }
+ Action {
+ text: "Unpin chat"
+ onTriggered: chatlistPage.context.setChatVisibility(model.chatId, 0)
+ }
+ Action {
+ text: "Archive chat"
+ onTriggered: chatlistPage.context.setChatVisibility(model.chatId, 1)
+ }
+ Action {
+ text: "Delete chat"
+ onTriggered: chatlistPage.context.deleteChat(model.chatId)
+ }
+ }
+ }
}
ScrollBar.vertical: ScrollBar {}