Debian Codegraph @

resources/qml/delegates/EncryptionEnabled.qml

raw
1 // SPDX-FileCopyrightText: Nheko Contributors
2 //
3 // SPDX-License-Identifier: GPL-3.0-or-later
4
5 import ".."
6 import QtQuick
7 import QtQuick.Controls
8 import QtQuick.Layouts
9 import im.nheko
10
11 Control {
12 id: r
13
14 required property string userName
15
16 padding: Nheko.paddingMedium
17 //implicitHeight: contents.implicitHeight + padd * 2
18 Layout.maximumWidth: contents.Layout.maximumWidth + padding * 2
19 Layout.fillWidth: true
20
21 contentItem: RowLayout {
22 id: contents
23
24 spacing: Nheko.paddingMedium
25
26 Image {
27 source: "image://colorimage/:/icons/icons/ui/shield-filled-checkmark.svg?" + Nheko.theme.green
28 Layout.alignment: Qt.AlignVCenter
29 Layout.preferredWidth: 24
30 Layout.preferredHeight: 24
31 }
32
33 ColumnLayout {
34 spacing: Nheko.paddingSmall
35 Layout.fillWidth: true
36
37 MatrixText {
38 text: qsTr("%1 enabled end-to-end encryption").arg(r.userName)
39 font.bold: true
40 font.pointSize: 14
41 color: palette.text
42 Layout.fillWidth: true
43 Layout.maximumWidth: implicitWidth + 1
44 }
45
46 Label {
47 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.")
48 textFormat: Text.PlainText
49 wrapMode: Label.WordWrap
50 color: palette.text
51 Layout.fillWidth: true
52 Layout.maximumWidth: implicitWidth + 1
53 }
54
55 }
56
57 }
58
59 background: Rectangle {
60 radius: fontMetrics.lineSpacing / 2 + Nheko.paddingMedium
61 height: contents.implicitHeight + Nheko.paddingMedium * 2
62 color: palette.alternateBase
63 border.color: Nheko.theme.green
64 border.width: 2
65 }
66 }