diff --git a/res/css/views/rooms/_E2EIcon.pcss b/res/css/views/rooms/_E2EIcon.pcss index f3aaf8a883..a8e3a34095 100644 --- a/res/css/views/rooms/_E2EIcon.pcss +++ b/res/css/views/rooms/_E2EIcon.pcss @@ -59,3 +59,10 @@ Please see LICENSE files in the repository root for full details. mask-image: url("$(res)/img/e2e/verified.svg"); background-color: $e2e-verified-color; } + +// When using the "normal" icon as a background for verified or warning icon, +// it should be slightly smaller than the foreground icon +.mx_E2EIcon_verified, .mx_E2EIcon_warning .mx_E2EIcon_normal::after { + mask-size: 90%; + background-color: white; +} diff --git a/src/components/views/rooms/E2EIcon.tsx b/src/components/views/rooms/E2EIcon.tsx index e4f19762ff..7cc76066ee 100644 --- a/src/components/views/rooms/E2EIcon.tsx +++ b/src/components/views/rooms/E2EIcon.tsx @@ -76,7 +76,17 @@ const E2EIcon: React.FC = ({ if (onClick) { content = ; } else { - content =
; + // Verified and warning icon have a transparent cutout, so add a white background. + // The normal icon already has the correct shape and size, so reuse that. + if (status === E2EStatus.Verified || status === E2EStatus.Warning) { + content = ( +
+
+
+ ); + } else { + content =
; + } } if (!e2eTitle || hideTooltip) { diff --git a/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap b/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap index d33ff73307..1196ce2202 100644 --- a/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap +++ b/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap @@ -1809,7 +1809,11 @@ exports[`RoomView should not display the timeline when the room encryption is lo
+ > +
+
should display the dialog for the device of a
+ > +
+
Not Trusted
@@ -97,7 +101,11 @@ exports[` should display the dialog for the device of t
+ > +
+
Not Trusted