Compact mode for messages

This commit is contained in:
miruka
2020-03-22 13:05:35 -04:00
parent 5d513f84fa
commit ce7c986e5b
2 changed files with 17 additions and 12 deletions

View File

@@ -13,9 +13,10 @@ HRowLayout {
readonly property string senderText:
hideNameLine ? "" : (
"<div class='sender'>" +
`<${smallAvatar ? "span" : "div"} class='sender'>` +
utils.coloredNameHtml(model.sender_name, model.sender_id) +
"</div>"
(smallAvatar ? ": " : "") +
(smallAvatar ? "</span>" : "</div>")
)
property string contentText: utils.processedEventText(model)
readonly property string timeText: utils.formatTime(model.date, false)
@@ -60,11 +61,12 @@ HRowLayout {
opacity: collapseAvatar ? 0 : 1
visible: ! hideAvatar
Layout.minimumWidth: theme.chat.message.avatarSize
Layout.minimumHeight:
collapseAvatar ? 1 :
smallAvatar ? theme.chat.message.collapsedAvatarSize :
Layout.minimumWidth
Layout.minimumWidth:
smallAvatar ?
theme.chat.message.collapsedAvatarSize :
theme.chat.message.avatarSize
Layout.minimumHeight: collapseAvatar ? 1 : Layout.minimumWidth
Layout.maximumWidth: Layout.minimumWidth
Layout.maximumHeight: Layout.minimumHeight
@@ -76,7 +78,7 @@ HRowLayout {
displayName: model.sender_name
mxc: model.sender_avatar
width: parent.width
height: collapseAvatar ? 1 : theme.chat.message.avatarSize
height: collapseAvatar ? 1 : parent.Layout.minimumWidth
radius: theme.chat.message.avatarRadius
}
}