moment/src/qml/Chat/RoomSidePane/MemberDelegate.qml

45 lines
1.1 KiB
QML
Raw Normal View History

2019-07-07 23:52:41 -04:00
// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
import QtQuick.Layouts 1.12
2019-05-12 13:17:42 -04:00
import "../../Base"
HHighlightRectangle {
2019-05-12 13:17:42 -04:00
id: memberDelegate
width: memberList.width
height: childrenRect.height
2019-07-07 22:41:32 -04:00
property var memberInfo: users.find(model.userId)
2019-05-12 13:17:42 -04:00
Row {
width: parent.width - leftPadding * 2
padding: roomSidePane.currentSpacing / 2
leftPadding: roomSidePane.currentSpacing
rightPadding: 0
2019-05-12 13:17:42 -04:00
HRowLayout {
width: parent.width
spacing: roomSidePane.currentSpacing
HUserAvatar {
id: avatar
userId: model.userId
}
2019-05-12 13:17:42 -04:00
HColumnLayout {
Layout.fillWidth: true
2019-05-12 13:17:42 -04:00
HLabel {
id: memberName
text: memberInfo.displayName || model.userId
elide: Text.ElideRight
verticalAlignment: Qt.AlignVCenter
2019-05-12 13:17:42 -04:00
Layout.fillWidth: true
}
2019-05-12 13:17:42 -04:00
}
}
}
}