moment/src/gui/Pages/Chat/RoomPane/MemberView.qml

83 lines
2.2 KiB
QML
Raw Normal View History

2019-12-19 22:46:16 +11:00
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import QtQuick.Layouts 1.12
2020-02-12 23:15:54 +11:00
import SortFilterProxyModel 0.2
import "../../.."
2019-12-18 19:53:08 +11:00
import "../../../Base"
2019-05-13 03:17:42 +10:00
HColumnLayout {
2019-05-14 03:15:03 +10:00
HListView {
2019-05-13 03:17:42 +10:00
id: memberList
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
delegate: MemberDelegate {
width: memberList.width
}
Layout.fillWidth: true
Layout.fillHeight: true
2019-05-13 03:17:42 +10:00
}
HRowLayout {
Layout.minimumHeight: theme.baseElementsHeight
Layout.maximumHeight: Layout.minimumHeight
HTextField {
id: filterField
saveName: "memberFilterField"
saveId: chat.roomId
placeholderText: qsTr("Filter members")
2019-12-11 05:57:54 +11:00
backgroundColor: theme.chat.roomPane.filterMembers.background
bordered: false
opacity: width >= 16 * theme.uiScale ? 1 : 0
2019-08-22 02:17:12 +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 {} }
}
HButton {
2019-12-12 03:42:59 +11:00
id: inviteButton
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
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)
Layout.fillHeight: true
}
}
2019-05-13 03:17:42 +10:00
}