aboutsummaryrefslogtreecommitdiff
path: root/qml/ChatlistPage.qml
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2021-03-01 01:05:27 +0300
committerlink2xt <link2xt@testrun.org>2021-03-01 01:05:52 +0300
commitae484d98e4067c514f9771eacb4714505eca84de (patch)
treee2ac81051ad2628cc0a6b7bbe986dbbfd1adab9c /qml/ChatlistPage.qml
parent768712e2536969e44d900aca5e28618218abb590 (diff)
downloadkdeltachat-ae484d98e4067c514f9771eacb4714505eca84de.tar.gz
kdeltachat-ae484d98e4067c514f9771eacb4714505eca84de.zip
chatlist: move mousearea to avatar
This prevents the error about anchors.fill used on layout-managed item.
Diffstat (limited to 'qml/ChatlistPage.qml')
-rw-r--r--qml/ChatlistPage.qml60
1 files changed, 29 insertions, 31 deletions
diff --git a/qml/ChatlistPage.qml b/qml/ChatlistPage.qml
index 98fd19c..c117a1f 100644
--- a/qml/ChatlistPage.qml
+++ b/qml/ChatlistPage.qml
@@ -133,6 +133,35 @@ Kirigami.Page {
name: model.chatName
implicitWidth: height
color: chatlistPage.context.getChat(model.chatId).getColor()
+ MouseArea {
+ anchors.fill: parent
+ acceptedButtons: Qt.RightButton
+ onClicked: {
+ if (mouse.button === Qt.RightButton)
+ 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)
+ }
+ }
+ }
}
trailing: Label {
@@ -140,37 +169,6 @@ Kirigami.Page {
visible: model.freshMsgCnt > 0
verticalAlignment: Text.AlignVCenter
}
-
- MouseArea {
- anchors.fill: parent
-
- acceptedButtons: Qt.RightButton
- onClicked: {
- if (mouse.button === Qt.RightButton)
- 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 {}