summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2019-09-19 23:02:56 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2019-11-23 20:06:14 +0100
commit82091999c4fc81412c726d28a339b305709bacd0 (patch)
treeafa8406ca95962cc8726103114683b4a1005b44c /resources/qml
parentRemove noisy decrypted message (diff)
downloadnheko-82091999c4fc81412c726d28a339b305709bacd0.tar.xz
Add lock to encrypted messages
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/EncryptionIndicator.qml30
-rw-r--r--resources/qml/TimelineView.qml6
2 files changed, 36 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