From 01324471daf96f62b684badafe97988d76a1620f Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Tue, 20 Dec 2022 13:41:41 -0500 Subject: [PATCH] Make call event tiles look less broken in the right panel --- res/css/views/elements/_FacePile.pcss | 2 +- res/css/views/messages/_CallEvent.pcss | 87 +++++++++++++-------- res/css/views/voip/_CallView.pcss | 5 +- res/img/element-icons/call/video-call.svg | 4 +- src/components/views/messages/CallEvent.tsx | 50 ++++++------ 5 files changed, 85 insertions(+), 63 deletions(-) diff --git a/res/css/views/elements/_FacePile.pcss b/res/css/views/elements/_FacePile.pcss index 4b2a732aa084..8b59a7f48e59 100644 --- a/res/css/views/elements/_FacePile.pcss +++ b/res/css/views/elements/_FacePile.pcss @@ -30,7 +30,7 @@ limitations under the License. } .mx_BaseAvatar_image { - border: 1px solid $background; + border: 1px solid var(--facepile-background, $background); } .mx_BaseAvatar_initial { diff --git a/res/css/views/messages/_CallEvent.pcss b/res/css/views/messages/_CallEvent.pcss index b9f41e88253c..599b2b86fe05 100644 --- a/res/css/views/messages/_CallEvent.pcss +++ b/res/css/views/messages/_CallEvent.pcss @@ -29,49 +29,70 @@ limitations under the License. border-radius: 8px; display: flex; - align-items: center; - justify-content: space-between; gap: $spacing-8; - .mx_CallEvent_title { - font-size: $font-15px; - line-height: 24px; /* in px to match the avatar */ + > .mx_BaseAvatar, + > .mx_Icon { + align-self: flex-start; } - &.mx_CallEvent_inactive .mx_CallEvent_title::before { - display: inline-block; - vertical-align: middle; - content: ""; - background-color: $secondary-content; - mask-image: url("$(res)/img/element-icons/call/video-call.svg"); - mask-size: 16px; - width: 16px; - height: 16px; - margin-right: 8px; + > .mx_Icon { + padding: 0; + margin: $spacing-4 0; + color: $secondary-content; } - &.mx_CallEvent_active .mx_CallEvent_title { - font-weight: 600; + .mx_LiveContentSummary { + font-size: $font-12px; } - > .mx_BaseAvatar { - align-self: flex-start; - } + --facepile-background: $system; +} - > .mx_CallEvent_infoRows { - flex-grow: 1; +.mx_CallEvent_title { + font-size: $font-15px; + line-height: 24px; /* in px to match the avatar */ +} - display: flex; - flex-direction: column; - gap: $spacing-4; - } +.mx_CallEvent_inactive .mx_CallEvent_title::before { + display: inline-block; + vertical-align: middle; + content: ""; + background-color: $secondary-content; + mask-image: url("$(res)/img/element-icons/call/video-call.svg"); + mask-size: 16px; + width: 16px; + height: 16px; + margin-right: $spacing-8; +} - > .mx_CallDuration { - padding: $spacing-4; - } +.mx_CallEvent_active .mx_CallEvent_title { + font-weight: $font-semi-bold; +} - > .mx_CallEvent_button { - box-sizing: border-box; - min-width: 120px; - } +.mx_CallEvent_columns { + flex-grow: 1; + display: flex; + gap: $spacing-12; + align-items: center; + justify-content: space-between; +} + +.mx_TimelineCard .mx_CallEvent_columns { + flex-direction: column; + align-items: flex-start; + gap: $spacing-8; +} + +.mx_CallEvent_details { + flex-grow: 1; + + display: flex; + flex-direction: column; + gap: 6px; +} + +.mx_CallEvent_button { + box-sizing: border-box; + min-width: 120px; } diff --git a/res/css/views/voip/_CallView.pcss b/res/css/views/voip/_CallView.pcss index fcdbce7351a4..17d3fd57f4d4 100644 --- a/res/css/views/voip/_CallView.pcss +++ b/res/css/views/voip/_CallView.pcss @@ -46,6 +46,7 @@ limitations under the License. padding: $spacing-12; color: $call-lobby-primary-content; background-color: $call-lobby-background; + --facepile-background: $call-lobby-background; border-radius: 8px; display: flex; @@ -57,10 +58,6 @@ limitations under the License. .mx_FacePile { width: fit-content; margin: $spacing-8 auto 0; - - .mx_FacePile_faces .mx_BaseAvatar_image { - border-color: $call-lobby-background; - } } .mx_CallView_preview { diff --git a/res/img/element-icons/call/video-call.svg b/res/img/element-icons/call/video-call.svg index 0c1cd2d41987..1d9546d03404 100644 --- a/res/img/element-icons/call/video-call.svg +++ b/res/img/element-icons/call/video-call.svg @@ -1,4 +1,4 @@ - - + + diff --git a/src/components/views/messages/CallEvent.tsx b/src/components/views/messages/CallEvent.tsx index 3006a4aebd29..45f77ef01a2f 100644 --- a/src/components/views/messages/CallEvent.tsx +++ b/src/components/views/messages/CallEvent.tsx @@ -66,28 +66,30 @@ const ActiveCallEvent = forwardRef( width={24} height={24} /> -
- - {_t("%(name)s started a video call", { name: senderName })} - - - +
+
+ + {_t("%(name)s started a video call", { name: senderName })} + + + +
+ {call && } + + {buttonText} +
- {call && } - - {buttonText} -
); @@ -171,8 +173,10 @@ export const CallEvent = forwardRef(({ mxEvent }, ref) => { return (
- {_t("Video call ended")} - +
+ {_t("Video call ended")} + +
);