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
|
|
|
|
import QtQuick.Layouts 1.12
|
2019-12-03 07:29:29 +11:00
|
|
|
import "../../.."
|
2019-12-18 19:53:08 +11:00
|
|
|
import "../../../Base"
|
2019-05-13 03:17:42 +10:00
|
|
|
|
2019-05-13 11:36:08 +10:00
|
|
|
HColumnLayout {
|
2019-05-14 03:15:03 +10:00
|
|
|
HListView {
|
2019-05-13 03:17:42 +10:00
|
|
|
id: memberList
|
2019-09-03 03:24:25 +10:00
|
|
|
clip: true
|
2019-05-13 03:17:42 +10:00
|
|
|
|
2019-12-03 07:29:29 +11:00
|
|
|
model: ModelStore.get(chat.userId, chat.roomId, "members")
|
|
|
|
// model: HSortFilterProxy {
|
|
|
|
// model: ModelStore.get(chat.userId, chat.roomId, "members")
|
|
|
|
|
|
|
|
// comparator: (a, b) =>
|
|
|
|
// // Sort by power level, then by display name or user ID (no @)
|
|
|
|
// [
|
|
|
|
// a.invited,
|
|
|
|
// b.power_level,
|
|
|
|
// (a.display_name || a.id.substring(1)).toLocaleLowerCase(),
|
|
|
|
// ] < [
|
|
|
|
// b.invited,
|
|
|
|
// a.power_level,
|
|
|
|
// (b.display_name || b.id.substring(1)).toLocaleLowerCase(),
|
|
|
|
// ]
|
|
|
|
|
|
|
|
// filter: (item, index) => utils.filterMatchesAny(
|
|
|
|
// filterField.text, item.display_name, item.id,
|
|
|
|
// )
|
|
|
|
// }
|
2019-07-07 19:25:03 +10:00
|
|
|
|
2019-08-21 18:39:07 +10:00
|
|
|
delegate: MemberDelegate {
|
|
|
|
width: memberList.width
|
|
|
|
}
|
2019-05-13 11:36:08 +10:00
|
|
|
|
2019-12-03 07:29:29 +11:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2019-05-13 03:17:42 +10:00
|
|
|
}
|
2019-05-17 05:39:44 +10:00
|
|
|
|
2019-08-22 23:27:26 +10:00
|
|
|
HRowLayout {
|
|
|
|
Layout.minimumHeight: theme.baseElementsHeight
|
|
|
|
Layout.maximumHeight: Layout.minimumHeight
|
2019-05-17 05:39:44 +10:00
|
|
|
|
2019-08-22 23:27:26 +10:00
|
|
|
HTextField {
|
|
|
|
id: filterField
|
2019-12-11 07:29:49 +11:00
|
|
|
saveName: "memberFilterField"
|
|
|
|
saveId: chat.roomId
|
|
|
|
|
2019-08-22 23:27:26 +10:00
|
|
|
placeholderText: qsTr("Filter members")
|
2019-12-11 05:57:54 +11:00
|
|
|
backgroundColor: theme.chat.roomPane.filterMembers.background
|
2019-08-22 23:27:26 +10:00
|
|
|
bordered: false
|
2019-12-16 05:56:40 +11:00
|
|
|
opacity: width >= 16 * theme.uiScale ? 1 : 0
|
2019-08-22 02:17:12 +10:00
|
|
|
|
2019-12-03 07:29:29 +11:00
|
|
|
onTextChanged: memberList.model.reFilter()
|
2019-08-22 23:27:26 +10:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2019-12-05 00:08:38 +11:00
|
|
|
|
2019-12-16 19:42:41 +11:00
|
|
|
Behavior on opacity { HNumberAnimation {} }
|
2019-08-22 23:27:26 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
2019-12-12 03:42:59 +11:00
|
|
|
id: inviteButton
|
2019-08-22 23:27:26 +10:00
|
|
|
icon.name: "room-send-invite"
|
2019-12-11 05:57:54 +11:00
|
|
|
backgroundColor: theme.chat.roomPane.inviteButton.background
|
2019-12-14 00:52:04 +11:00
|
|
|
enabled: chat.roomInfo.can_invite
|
2019-12-12 03:42:59 +11:00
|
|
|
|
|
|
|
toolTip.text:
|
|
|
|
enabled ?
|
|
|
|
qsTr("Invite members to this room") :
|
2019-12-23 02:21:47 +11:00
|
|
|
qsTr("No permission to invite members to this room")
|
2019-12-12 03:42:59 +11:00
|
|
|
|
|
|
|
topPadding: 0 // XXX
|
|
|
|
bottomPadding: 0
|
|
|
|
|
2019-12-18 08:59:53 +11:00
|
|
|
onClicked: utils.makePopup(
|
2019-12-12 03:42:59 +11:00
|
|
|
"Popups/InviteToRoomPopup.qml",
|
|
|
|
chat,
|
|
|
|
{
|
|
|
|
userId: chat.userId,
|
|
|
|
roomId: chat.roomId,
|
2019-12-14 08:08:59 +11:00
|
|
|
roomName: chat.roomInfo.display_name,
|
2019-12-12 03:42:59 +11:00
|
|
|
invitingAllowed: Qt.binding(() => inviteButton.enabled),
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
// onEnabledChanged: if (openedPopup && ! enabled)
|
2019-08-22 23:27:26 +10:00
|
|
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
2019-05-17 05:39:44 +10:00
|
|
|
}
|
2019-05-13 03:17:42 +10:00
|
|
|
}
|