2019-12-19 22:46:16 +11:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2019-07-13 19:39:01 +10:00
|
|
|
import QtQuick 2.12
|
2019-12-18 19:53:08 +11:00
|
|
|
import "../../../Base"
|
2019-05-13 03:17:42 +10:00
|
|
|
|
2019-08-21 18:39:07 +10:00
|
|
|
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
|
2019-12-18 00:46:18 +11:00
|
|
|
contentOpacity:
|
|
|
|
model.invited ? theme.chat.roomPane.member.invitedOpacity : 1
|
2019-05-13 03:17:42 +10:00
|
|
|
|
2019-08-21 18:39:07 +10:00
|
|
|
image: HUserAvatar {
|
|
|
|
userId: model.user_id
|
|
|
|
displayName: model.display_name
|
2019-11-04 04:48:12 +11:00
|
|
|
mxc: model.avatar_url
|
2019-11-30 19:59:02 +11:00
|
|
|
powerLevel: model.power_level
|
2019-12-18 00:46:18 +11:00
|
|
|
shiftMembershipIconPosition: ! roomPane.collapsed
|
|
|
|
invited: model.invited
|
2019-05-13 03:17:42 +10:00
|
|
|
}
|
2019-08-21 18:39:07 +10:00
|
|
|
|
|
|
|
title.text: model.display_name || model.user_id
|
2019-11-30 20:12:00 +11:00
|
|
|
title.color:
|
|
|
|
memberDelegate.hovered ?
|
2019-12-18 08:59:53 +11:00
|
|
|
utils.nameColor(model.display_name || model.user_id.substring(1)) :
|
2019-12-11 05:57:54 +11:00
|
|
|
theme.chat.roomPane.member.name
|
2019-08-22 19:42:48 +10:00
|
|
|
|
2019-12-12 06:12:21 +11:00
|
|
|
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 {} }
|
2019-12-18 00:46:18 +11:00
|
|
|
Behavior on contentOpacity { HNumberAnimation {} }
|
2019-12-22 03:46:47 +11:00
|
|
|
Behavior on spacing { HNumberAnimation {} }
|
|
|
|
|
|
|
|
Binding on spacing {
|
2019-12-27 02:09:40 +11:00
|
|
|
id: spacebind
|
2019-12-22 03:46:47 +11:00
|
|
|
value: (roomPane.minimumSize - loadedImage.width) / 2
|
|
|
|
when: loadedImage &&
|
|
|
|
roomPane.width < loadedImage.width + theme.spacing * 2
|
|
|
|
}
|
2019-05-13 03:17:42 +10:00
|
|
|
}
|