diff --git a/resources/icons/ui/shield-filled-checkmark.svg b/resources/icons/ui/shield-filled-checkmark.svg new file mode 100644 index 00000000..4f472546 --- /dev/null +++ b/resources/icons/ui/shield-filled-checkmark.svg @@ -0,0 +1 @@ + diff --git a/resources/icons/ui/shield-filled-cross.svg b/resources/icons/ui/shield-filled-cross.svg new file mode 100644 index 00000000..a3b1a6a5 --- /dev/null +++ b/resources/icons/ui/shield-filled-cross.svg @@ -0,0 +1 @@ + diff --git a/resources/icons/ui/shield-filled-exclamation-mark.svg b/resources/icons/ui/shield-filled-exclamation-mark.svg new file mode 100644 index 00000000..1fc7ff1f --- /dev/null +++ b/resources/icons/ui/shield-filled-exclamation-mark.svg @@ -0,0 +1 @@ + diff --git a/resources/icons/ui/shield-filled.svg b/resources/icons/ui/shield-filled.svg new file mode 100644 index 00000000..d89abdac --- /dev/null +++ b/resources/icons/ui/shield-filled.svg @@ -0,0 +1 @@ + diff --git a/resources/icons/ui/shield-small-filled.svg b/resources/icons/ui/shield-small-filled.svg deleted file mode 100644 index 34baa6e0..00000000 --- a/resources/icons/ui/shield-small-filled.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/resources/icons/ui/shield-unprotected.svg b/resources/icons/ui/shield-unprotected.svg deleted file mode 100644 index 65602870..00000000 --- a/resources/icons/ui/shield-unprotected.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/resources/icons/ui/shield.svg b/resources/icons/ui/shield.svg deleted file mode 100644 index 43c1d16d..00000000 --- a/resources/icons/ui/shield.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/resources/qml/EncryptionIndicator.qml b/resources/qml/EncryptionIndicator.qml index 7124cc53..0bd0dfa1 100644 --- a/resources/qml/EncryptionIndicator.qml +++ b/resources/qml/EncryptionIndicator.qml @@ -13,14 +13,25 @@ Image { property int trust: Crypto.Unverified property string sourceUrl: { - if (width <= 16 || height <= 16) - return "image://colorimage/:/icons/icons/ui/shield-small-filled.svg?"; - else - return "image://colorimage/:/icons/icons/ui/shield.svg?"; + if (!encrypted) + return "image://colorimage/:/icons/icons/ui/shield-filled-cross.svg?"; + + switch (trust) { + case Crypto.Verified: + return "image://colorimage/:/icons/icons/ui/shield-filled-checkmark.svg?"; + case Crypto.TOFU: + return "image://colorimage/:/icons/icons/ui/shield-filled.svg?"; + case Crypto.Unverified: + return "image://colorimage/:/icons/icons/ui/shield-filled-exclamation-mark.svg?"; + default: + return "image://colorimage/:/icons/icons/ui/shield-filled-cross.svg?"; + } } width: 16 height: 16 + sourceSize.height: height + sourceSize.width: width source: { if (encrypted) { switch (trust) { diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml index 433cd321..45ce289a 100644 --- a/resources/qml/TopBar.qml +++ b/resources/qml/TopBar.qml @@ -117,6 +117,8 @@ Rectangle { Layout.rowSpan: 2 Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium Layout.preferredWidth: Nheko.avatarSize - Nheko.paddingMedium + sourceSize.height: Layout.preferredHeight + sourceSize.width: Layout.preferredWidth visible: isEncrypted encrypted: isEncrypted trust: trustlevel diff --git a/resources/qml/dialogs/UserProfile.qml b/resources/qml/dialogs/UserProfile.qml index e4a0a6cb..6c8f9ba2 100644 --- a/resources/qml/dialogs/UserProfile.qml +++ b/resources/qml/dialogs/UserProfile.qml @@ -213,12 +213,13 @@ ApplicationWindow { onClicked: profile.verify() } - Image { + EncryptionIndicator { Layout.preferredHeight: 16 Layout.preferredWidth: 16 - source: "image://colorimage/:/icons/icons/ui/shield-small-filled.svg?" + ((profile.userVerified == Crypto.Verified) ? "green" : Nheko.colors.buttonText) - visible: profile.userVerified != Crypto.Unverified + encrypted: profile.userVerificationEnabled + trust: profile.userVerified Layout.alignment: Qt.AlignHCenter + ToolTip.visible: false } RowLayout { @@ -304,16 +305,18 @@ ApplicationWindow { Layout.preferredHeight: 16 Layout.preferredWidth: 16 visible: profile.isSelf && verificationStatus != VerificationStatus.NOT_APPLICABLE + sourceSize.height: 16 + sourceSize.width: 16 source: { switch (verificationStatus) { case VerificationStatus.VERIFIED: - return "image://colorimage/:/icons/icons/ui/shield-small-filled.svg?green"; + return "image://colorimage/:/icons/icons/ui/shield-filled-checkmark.svg?green"; case VerificationStatus.UNVERIFIED: - return "image://colorimage/:/icons/icons/ui/shield-unprotected.svg?#d6c020"; + return "image://colorimage/:/icons/icons/ui/shield-filled-exclamation-mark.svg?#d6c020"; case VerificationStatus.SELF: - return "image://colorimage/:/icons/icons/ui/checkmark.svg?green"; + return "image://colorimage/:/icons/ui/checkmark.svg?green"; default: - return "image://colorimage/:/icons/icons/ui/shield-unprotected.svg?red"; + return "image://colorimage/:/icons/ui/shield-filled-cross.svg?#d6c020"; } } } @@ -388,13 +391,13 @@ ApplicationWindow { source: { switch (verificationStatus) { case VerificationStatus.VERIFIED: - return "image://colorimage/:/icons/icons/ui/shield-small-filled.svg?green"; + return "image://colorimage/:/icons/icons/ui/shield-filled-checkmark.svg?green"; case VerificationStatus.UNVERIFIED: - return "image://colorimage/:/icons/icons/ui/shield-unprotected.svg?#d6c020"; + return "image://colorimage/:/icons/icons/ui/shield-filled-exclamation-mark.svg?#d6c020"; case VerificationStatus.SELF: return "image://colorimage/:/icons/icons/ui/checkmark.svg?green"; default: - return "image://colorimage/:/icons/icons/ui/shield-unprotected.svg?red"; + return "image://colorimage/:/icons/icons/ui/shield-filled.svg?red"; } } } diff --git a/resources/res.qrc b/resources/res.qrc index 898bcb66..838aeadb 100644 --- a/resources/res.qrc +++ b/resources/res.qrc @@ -25,8 +25,6 @@ icons/ui/screen-share.svg icons/ui/search.svg icons/ui/settings.svg - icons/ui/shield-unprotected.svg - icons/ui/shield.svg icons/ui/speech-bubbles.svg icons/ui/star.svg icons/ui/tag.svg @@ -49,7 +47,10 @@ icons/emoji-categories/people.svg icons/emoji-categories/symbols.svg icons/emoji-categories/travel.svg - icons/ui/shield-small-filled.svg + icons/ui/shield-filled.svg + icons/ui/shield-filled-exclamation-mark.svg + icons/ui/shield-filled-checkmark.svg + icons/ui/shield-filled-cross.svg nheko.png