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
|
2020-02-12 23:15:54 +11:00
|
|
|
import SortFilterProxyModel 0.2
|
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
|
|
|
|
2020-03-10 20:38:28 +11:00
|
|
|
model: HSortFilterProxyModel {
|
2020-02-12 23:15:54 +11:00
|
|
|
sourceModel: ModelStore.get(chat.userId, chat.roomId, "members")
|
|
|
|
|
|
|
|
filters: ExpressionFilter {
|
|
|
|
expression: utils.filterMatches(
|
|
|
|
filterField.text, model.display_name,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
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
|
2020-03-13 16:09:04 +11:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
z: -100
|
|
|
|
color: theme.chat.roomPane.listView.background
|
|
|
|
}
|
2019-05-13 03:17:42 +10:00
|
|
|
}
|
2019-05-17 05:39:44 +10:00
|
|
|
|
2020-03-13 16:09:04 +11:00
|
|
|
Rectangle {
|
|
|
|
color: theme.chat.roomPane.bottomBar.background
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2019-08-22 23:27:26 +10:00
|
|
|
Layout.minimumHeight: theme.baseElementsHeight
|
|
|
|
Layout.maximumHeight: Layout.minimumHeight
|
2019-05-17 05:39:44 +10:00
|
|
|
|
2020-03-13 16:09:04 +11:00
|
|
|
HRowLayout {
|
|
|
|
anchors.fill: parent
|
2019-12-11 07:29:49 +11:00
|
|
|
|
2020-03-13 16:09:04 +11:00
|
|
|
HTextField {
|
|
|
|
id: filterField
|
|
|
|
saveName: "memberFilterField"
|
|
|
|
saveId: chat.roomId
|
2019-08-22 02:17:12 +10:00
|
|
|
|
2020-03-13 16:09:04 +11:00
|
|
|
backgroundColor:
|
|
|
|
theme.chat.roomPane.bottomBar.filterMembers.background
|
|
|
|
bordered: false
|
|
|
|
opacity: width >= 16 * theme.uiScale ? 1 : 0
|
2019-12-05 00:08:38 +11:00
|
|
|
|
2020-03-13 16:09:04 +11:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2019-08-22 23:27:26 +10:00
|
|
|
|
2020-03-14 01:34:37 +11:00
|
|
|
// FIXME: fails to display sometimes for some reason if
|
|
|
|
// declared normally
|
|
|
|
Component.onCompleted: placeholderText = qsTr("Filter members")
|
|
|
|
|
2020-03-13 16:09:04 +11:00
|
|
|
Behavior on opacity { HNumberAnimation {} }
|
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
id: inviteButton
|
|
|
|
icon.name: "room-send-invite"
|
|
|
|
backgroundColor:
|
|
|
|
theme.chat.roomPane.bottomBar.inviteButton.background
|
|
|
|
enabled: chat.roomInfo.can_invite
|
|
|
|
|
|
|
|
toolTip.text:
|
|
|
|
enabled ?
|
|
|
|
qsTr("Invite members to this room") :
|
|
|
|
qsTr("No permission to invite members to this room")
|
|
|
|
|
|
|
|
topPadding: 0 // XXX
|
|
|
|
bottomPadding: 0
|
|
|
|
|
|
|
|
onClicked: utils.makePopup(
|
|
|
|
"Popups/InviteToRoomPopup.qml",
|
|
|
|
chat,
|
|
|
|
{
|
|
|
|
userId: chat.userId,
|
|
|
|
roomId: chat.roomId,
|
|
|
|
roomName: chat.roomInfo.display_name,
|
|
|
|
invitingAllowed:
|
|
|
|
Qt.binding(() => inviteButton.enabled),
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
// onEnabledChanged: if (openedPopup && ! enabled)
|
|
|
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
2019-08-22 23:27:26 +10:00
|
|
|
}
|
2019-05-17 05:39:44 +10:00
|
|
|
}
|
2019-05-13 03:17:42 +10:00
|
|
|
}
|