aboutsummaryrefslogtreecommitdiff
path: root/qml
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2020-10-13 02:34:42 +0300
committerlink2xt <link2xt@testrun.org>2020-10-13 02:34:42 +0300
commite84f17304ad0534e161346c22151f23e6577b75a (patch)
treea2ca972c9ebb8bdfb112246b64e3a7ec7843cf3a /qml
parent5fc369cc6f0547fc38435492581adb4783d04163 (diff)
downloadkdeltachat-e84f17304ad0534e161346c22151f23e6577b75a.tar.gz
kdeltachat-e84f17304ad0534e161346c22151f23e6577b75a.zip
Add info dialog for messages
Diffstat (limited to 'qml')
-rw-r--r--qml/Message.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/qml/Message.qml b/qml/Message.qml
index 3936e4e..9170676 100644
--- a/qml/Message.qml
+++ b/qml/Message.qml
@@ -2,6 +2,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQml.Models 2.1
+import QtQuick.Dialogs 1.1
import org.kde.kirigami 2.12 as Kirigami
import DeltaChat 1.0
@@ -53,11 +54,41 @@ RowLayout {
color: Kirigami.Theme.backgroundColor
radius: 5
+ 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()
+ }
+
+ MessageDialog {
+ id: messageDialog
+ title: "Message info"
+ text: context.getMessageInfo(messageObject.message.id)
+ onAccepted: { }
+ }
+
+ Menu {
+ id: contextMenu
+ Action {
+ text: "Info"
+ onTriggered: messageDialog.open()
+ }
+ }
+ }
+
ColumnLayout {
id: messageContents
anchors.centerIn: parent
+
Loader {
sourceComponent: messageObject.message.viewtype == 20 ? imageMessageView : textMessageView
}