Show inviter as subtitle for room list invites

Also fixes the centering of the enveloppe icon for invited rooms with a
subtitle.
This commit is contained in:
miruka 2021-04-16 10:33:16 -04:00
parent 02b4bddce5
commit c9ee604cf3

View File

@ -80,17 +80,6 @@ HTile {
localUnreads: model.local_unreads localUnreads: model.local_unreads
} }
HIcon {
svgName: "invite-received"
colorize: theme.colors.alertBackground
small: room.compact
visible: invited
Layout.maximumWidth: invited ? implicitWidth : 0
Behavior on Layout.maximumWidth { HNumberAnimation {} }
}
TitleRightInfoLabel { TitleRightInfoLabel {
tile: room tile: room
color: theme.mainPane.listView.room.lastEventDate color: theme.mainPane.listView.room.lastEventDate
@ -106,6 +95,18 @@ HTile {
lastEvent && lastEvent.event_type === "RoomMessageEmote" lastEvent && lastEvent.event_type === "RoomMessageEmote"
text: { text: {
// If this is a room invite with no last event to show,
// and the room name isn't just the inviter's name
if (
! lastEvent && model.inviter_id && (
! model.display_name ||
model.inviter_name !== model.display_name
)
)
return utils.coloredNameHtml(
model.inviter_name, model.inviter_id,
)
if (! lastEvent) return "" if (! lastEvent) return ""
const ev_type = lastEvent.event_type const ev_type = lastEvent.event_type
@ -135,6 +136,17 @@ HTile {
} }
} }
} }
HIcon {
svgName: "invite-received"
colorize: theme.colors.alertBackground
small: room.compact
visible: invited
Layout.maximumWidth: invited ? implicitWidth : 0
Behavior on Layout.maximumWidth { HNumberAnimation {} }
}
} }
contextMenu: HMenu { contextMenu: HMenu {