diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2019-09-19 23:02:56 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2019-11-23 20:06:14 +0100 |
commit | 82091999c4fc81412c726d28a339b305709bacd0 (patch) | |
tree | afa8406ca95962cc8726103114683b4a1005b44c /resources | |
parent | a5ccd00be0d58970a37944a68a91b7902cbf450f (diff) |
Add lock to encrypted messages
Diffstat (limited to 'resources')
-rw-r--r-- | resources/qml/EncryptionIndicator.qml | 30 | ||||
-rw-r--r-- | resources/qml/TimelineView.qml | 6 | ||||
-rw-r--r-- | resources/res.qrc | 1 |
3 files changed, 37 insertions, 0 deletions
diff --git a/resources/qml/EncryptionIndicator.qml b/resources/qml/EncryptionIndicator.qml new file mode 100644 index 00000000..6cb5138a --- /dev/null +++ b/resources/qml/EncryptionIndicator.qml @@ -0,0 +1,30 @@ +import QtQuick 2.5 +import QtQuick.Controls 2.5 +import QtGraphicalEffects 1.0 +import com.github.nheko 1.0 + +Rectangle { + id: indicator + color: "transparent" + width: 16 + height: 16 + ToolTip.visible: ma.containsMouse && indicator.visible + ToolTip.text: qsTr("Encrypted") + MouseArea{ + id: ma + anchors.fill: parent + hoverEnabled: true + } + + Image { + id: stateImg + anchors.fill: parent + source: "qrc:/icons/icons/ui/lock.png" + } + ColorOverlay { + anchors.fill: stateImg + source: stateImg + color: colors.buttonText + } +} + diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index a04c0c7f..ee4b53b9 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -124,6 +124,12 @@ Rectangle { Layout.preferredHeight: 16 } + EncryptionIndicator { + visible: model.isEncrypted + Layout.alignment: Qt.AlignRight | Qt.AlignTop + Layout.preferredHeight: 16 + } + Button { Layout.alignment: Qt.AlignRight | Qt.AlignTop id: replyButton diff --git a/resources/res.qrc b/resources/res.qrc index a9cf885b..02b4c0c0 100644 --- a/resources/res.qrc +++ b/resources/res.qrc @@ -118,6 +118,7 @@ <file>qml/TimelineView.qml</file> <file>qml/Avatar.qml</file> <file>qml/StatusIndicator.qml</file> + <file>qml/EncryptionIndicator.qml</file> <file>qml/delegates/TextMessage.qml</file> <file>qml/delegates/NoticeMessage.qml</file> <file>qml/delegates/ImageMessage.qml</file> |