2 files changed, 19 insertions, 3 deletions
diff --git a/resources/qml/EncryptionIndicator.qml b/resources/qml/EncryptionIndicator.qml
index 00fe2ee4..428c2fae 100644
--- a/resources/qml/EncryptionIndicator.qml
+++ b/resources/qml/EncryptionIndicator.qml
@@ -3,13 +3,14 @@ import QtQuick.Controls 2.1
import im.nheko 1.0
Rectangle {
+ property bool encrypted: false
id: indicator
color: "transparent"
width: 16
height: 16
ToolTip.visible: ma.containsMouse && indicator.visible
- ToolTip.text: qsTr("Encrypted")
+ ToolTip.text: getEncryptionTooltip()
MouseArea{
id: ma
@@ -20,7 +21,21 @@ Rectangle {
Image {
id: stateImg
anchors.fill: parent
- source: "image://colorimage/:/icons/icons/ui/lock.png?"+colors.buttonText
+ source: getEncryptionImage()
+ }
+
+ function getEncryptionImage() {
+ if (encrypted)
+ return "image://colorimage/:/icons/icons/ui/lock.png?"+colors.buttonText
+ else
+ return "image://colorimage/:/icons/icons/ui/unlock.png?#dd3d3d"
+ }
+
+ function getEncryptionTooltip() {
+ if (encrypted)
+ return qsTr("Encrypted")
+ else
+ return qsTr("This message is not encrypted!")
}
}
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index 22222ef3..8dcd0056 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -66,7 +66,8 @@ MouseArea {
}
EncryptionIndicator {
- visible: model.isEncrypted
+ visible: model.isRoomEncrypted
+ encrypted: model.isEncrypted
Layout.alignment: Qt.AlignRight | Qt.AlignTop
Layout.preferredHeight: 16
width: 16
|