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

29 lines
759 B
QML
Raw Normal View History

import QtQuick 2.12
2019-05-13 03:17:42 +10:00
import "../../Base"
2019-11-30 20:12:00 +11:00
import "../../utils.js" as Utils
2019-05-13 03:17:42 +10:00
HTileDelegate {
2019-05-13 03:17:42 +10:00
id: memberDelegate
spacing: roomSidePane.currentSpacing
backgroundColor: theme.chat.roomSidePane.member.background
2019-05-13 03:17:42 +10:00
image: HUserAvatar {
userId: model.user_id
displayName: model.display_name
mxc: model.avatar_url
2019-11-30 19:59:02 +11:00
powerLevel: model.power_level
2019-05-13 03:17:42 +10:00
}
title.text: model.display_name || model.user_id
2019-11-30 20:12:00 +11:00
title.color:
memberDelegate.hovered ?
Utils.nameColor(model.display_name || model.user_id.substring(1)) :
theme.chat.roomSidePane.member.name
subtitle.text: model.user_id
subtitle.color: theme.chat.roomSidePane.member.subtitle
2019-11-30 20:12:00 +11:00
Behavior on title.color { HColorAnimation {} }
2019-05-13 03:17:42 +10:00
}