From f261bbb32d05cd70260a97725c5d84e4a5fe451c Mon Sep 17 00:00:00 2001
From: Nicolas Werner <nicolas.werner@hotmail.de>
Date: Sat, 16 Jul 2022 12:58:17 +0200
Subject: [PATCH] Fix weird spacing and hidden encryption indicator in top bar

---
 resources/qml/EncryptionIndicator.qml | 6 ++++--
 resources/qml/TopBar.qml              | 7 ++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/resources/qml/EncryptionIndicator.qml b/resources/qml/EncryptionIndicator.qml
index b0f479faa..7455149dd 100644
--- a/resources/qml/EncryptionIndicator.qml
+++ b/resources/qml/EncryptionIndicator.qml
@@ -13,10 +13,12 @@ Image {
 
     property bool encrypted: false
     property int trust: Crypto.Unverified
+    property string unencryptedIcon: ":/icons/icons/ui/shield-filled-cross.svg"
+    property color unencryptedColor: Nheko.theme.error
 
     property string sourceUrl: {
         if (!encrypted)
-        return "image://colorimage/:/icons/icons/ui/shield-filled-cross.svg?";
+        return "image://colorimage/"+unencryptedIcon+"?";
 
         switch (trust) {
             case Crypto.Verified:
@@ -45,7 +47,7 @@ Image {
                 return sourceUrl + Nheko.theme.error;
             }
         } else {
-            return sourceUrl + Nheko.theme.error;
+            return sourceUrl + unencryptedColor;
         }
     }
     ToolTip.visible: ma.hovered
diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml
index c9d26019c..2f94cf844 100644
--- a/resources/qml/TopBar.qml
+++ b/resources/qml/TopBar.qml
@@ -144,10 +144,11 @@ Pane {
                 contentItem: EncryptionIndicator {
                     sourceSize.height: parent.Layout.preferredHeight * Screen.devicePixelRatio
                     sourceSize.width: parent.Layout.preferredWidth * Screen.devicePixelRatio
-                    visible: isEncrypted
                     encrypted: isEncrypted
                     trust: trustlevel
                     enabled: false
+                    unencryptedIcon: ":/icons/icons/ui/people.svg"
+                    unencryptedColor: Nheko.colors.buttonText
                 }
 
                 background: null
@@ -155,7 +156,7 @@ Pane {
                 ToolTip.delay: Nheko.tooltipDelay
                 ToolTip.text: {
                     if (!isEncrypted)
-                    return qsTr("This room is not encrypted!");
+                    return qsTr("Show room members.");
 
                     switch (trustlevel) {
                         case Crypto.Verified:
@@ -330,7 +331,7 @@ Pane {
 
                 Layout.row: 3
                 Layout.column: 2
-                Layout.columnSpan: 3
+                Layout.columnSpan: 1
 
                 Layout.fillWidth: true
                 Layout.preferredHeight: Math.min(contentHeight, Nheko.avatarSize * 1.5)
-- 
GitLab