summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2023-02-14 18:54:43 +0100
committerGitHub <noreply@github.com>2023-02-14 18:54:43 +0100
commit009d1a8e2db12bd5d69f2fe9515cbdb21b066f84 (patch)
treee0d7b754284042deba58b920790404d0aeca3a1f /resources/qml
parentMerge pull request #1365 from Nheko-Reborn/video_improvements (diff)
parentUpdate resources/qml/delegates/EncryptionEnabled.qml (diff)
downloadnheko-009d1a8e2db12bd5d69f2fe9515cbdb21b066f84.tar.xz
Merge pull request #1359 from Nheko-Reborn/encryption_delegate
Add a fancy delegate when encryption is enabled
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/delegates/EncryptionEnabled.qml60
-rw-r--r--resources/qml/delegates/MessageDelegate.qml5
2 files changed, 62 insertions, 3 deletions
diff --git a/resources/qml/delegates/EncryptionEnabled.qml b/resources/qml/delegates/EncryptionEnabled.qml
new file mode 100644
index 00000000..d23e0469
--- /dev/null
+++ b/resources/qml/delegates/EncryptionEnabled.qml
@@ -0,0 +1,60 @@
+// SPDX-FileCopyrightText: 2023 Nheko Contributors
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+import ".."
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Layouts 1.15
+import im.nheko 1.0
+
+Rectangle {
+    id: r
+
+    required property string username
+
+    radius: fontMetrics.lineSpacing / 2 + Nheko.paddingMedium
+    width: parent.width ? Math.min(parent.width, 700) : 0
+    anchors.horizontalCenter: parent.horizontalCenter
+    height: contents.implicitHeight + Nheko.paddingMedium * 2
+    color: Nheko.colors.alternateBase
+    border.color: Nheko.theme.green
+    border.width: 2
+
+    RowLayout {
+        id: contents
+
+        anchors.fill: parent
+        anchors.margins: Nheko.paddingMedium
+        spacing: Nheko.paddingMedium
+
+        Image {
+            source: "image://colorimage/:/icons/icons/ui/shield-filled-checkmark.svg?" + Nheko.theme.green
+            Layout.alignment: Qt.AlignVCenter
+            width: 24
+            height: width
+        }
+
+        Column {
+            spacing: Nheko.paddingSmall
+            Layout.fillWidth: true
+
+            MatrixText {
+                text: qsTr("%1 enabled end-to-end encryption").arg(r.username)
+                font.bold: true
+                font.pointSize: 14
+                color: Nheko.colors.text
+                width: parent.width
+            }
+
+            MatrixText {
+                text: qsTr("Encryption keeps your messages safe by only allowing the people you sent the message to to read it. For extra security, if you want to make sure you are talking to the right people, you can verify them in real life.")
+                color: Nheko.colors.text
+                width: parent.width
+            }
+
+        }
+
+    }
+
+}
diff --git a/resources/qml/delegates/MessageDelegate.qml b/resources/qml/delegates/MessageDelegate.qml
index d0569c5a..e8b76b6e 100644
--- a/resources/qml/delegates/MessageDelegate.qml
+++ b/resources/qml/delegates/MessageDelegate.qml
@@ -253,9 +253,8 @@ Item {
         DelegateChoice {
             roleValue: MtxEvent.Encryption
 
-            Pill {
-                text: qsTr("%1 enabled encryption").arg(d.userName)
-                isStateEvent: d.isStateEvent
+            EncryptionEnabled {
+                username: d.userName
             }
 
         }