From 7238ca376559c8e9ab289d9d333a532d9cdb189a Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 5 Mar 2022 01:44:10 +0100 Subject: [PATCH] Open room members dialog when clicking the encryption indicator fixes #937 --- resources/qml/TopBar.qml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml index 77eed1b0..32149cc8 100644 --- a/resources/qml/TopBar.qml +++ b/resources/qml/TopBar.qml @@ -134,22 +134,30 @@ Pane { text: roomTopic } - EncryptionIndicator { + AbstractButton { Layout.column: 3 Layout.row: 0 Layout.rowSpan: 2 Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium Layout.preferredWidth: Nheko.avatarSize - Nheko.paddingMedium - sourceSize.height: Layout.preferredHeight * Screen.devicePixelRatio - sourceSize.width: Layout.preferredWidth * Screen.devicePixelRatio - visible: isEncrypted - encrypted: isEncrypted - trust: trustlevel + + contentItem: EncryptionIndicator { + sourceSize.height: parent.Layout.preferredHeight * Screen.devicePixelRatio + sourceSize.width: parent.Layout.preferredWidth * Screen.devicePixelRatio + visible: isEncrypted + encrypted: isEncrypted + trust: trustlevel + enabled: false + } + + background: null + + ToolTip.delay: Nheko.tooltipDelay ToolTip.text: { - if (!encrypted) + if (!isEncrypted) return qsTr("This room is not encrypted!"); - switch (trust) { + switch (trustlevel) { case Crypto.Verified: return qsTr("This room contains only verified devices."); case Crypto.TOFU: @@ -158,6 +166,9 @@ Pane { return qsTr("This room contains unverified devices!"); } } + ToolTip.visible: hovered + + onClicked: TimelineManager.openRoomMembers(room) } ImageButton {