Add HUserAvatar and HRoomAvatar components

This commit is contained in:
miruka
2019-07-07 00:24:23 -04:00
parent 064fb6e9a2
commit 683ee3e1cf
14 changed files with 55 additions and 59 deletions

View File

@@ -17,7 +17,7 @@ HRectangle {
id: bannerRow
anchors.fill: parent
HAvatar {
HUserAvatar {
id: bannerAvatar
dimension: banner.Layout.preferredHeight
}

View File

@@ -10,9 +10,7 @@ Banner {
color: theme.chat.inviteBanner.background
avatar.name: inviterId ? (inviterInfo.displayName ||
Utils.stripUserId(inviterId)) : ""
avatar.imageUrl: inviterId ? inviterInfo.avatarUrl : ""
avatar.userId: inviterId
labelText: qsTr("%1 invited you to join the room.").arg(
inviterId ?

View File

@@ -1,6 +1,5 @@
import QtQuick 2.7
import "../../Base"
import "../../utils.js" as Utils
Banner {
property string userId: ""
@@ -9,7 +8,7 @@ Banner {
color: theme.chat.leftBanner.background
// TODO: avatar func auto
avatar.name: userInfo.displayName || Utils.stripUserId(userId)
avatar.userId: userId
avatar.imageUrl: users.getUser(userId).avatarUrl
labelText: qsTr("You are not part of this room anymore.")