moment/src/gui/Chat/RoomPane/MemberDelegate.qml

40 lines
1.1 KiB
QML
Raw Normal View History

import QtQuick 2.12
2019-05-13 03:17:42 +10:00
import "../../Base"
HTileDelegate {
2019-05-13 03:17:42 +10:00
id: memberDelegate
2019-12-11 05:57:54 +11:00
backgroundColor: theme.chat.roomPane.member.background
contentOpacity:
model.invited ? theme.chat.roomPane.member.invitedOpacity : 1
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
shiftMembershipIconPosition: ! roomPane.collapsed
invited: model.invited
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)) :
2019-12-11 05:57:54 +11:00
theme.chat.roomPane.member.name
subtitle.text: model.display_name ? model.user_id : ""
2019-12-11 05:57:54 +11:00
subtitle.color: theme.chat.roomPane.member.subtitle
2019-11-30 20:12:00 +11:00
2019-12-12 23:32:50 +11:00
contextMenu: HMenu {
HMenuItem {
icon.name: "copy-user-id"
text: qsTr("Copy user ID")
onTriggered: Clipboard.text = model.user_id
}
}
2019-11-30 20:12:00 +11:00
Behavior on title.color { HColorAnimation {} }
Behavior on contentOpacity { HNumberAnimation {} }
2019-05-13 03:17:42 +10:00
}