2020-12-11 20:38:10 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.3
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-12-11 20:38:10 +00:00
|
|
|
import "../../../../shared"
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
property alias membersData: membersData
|
|
|
|
property string searchString
|
|
|
|
property bool selectMode: true
|
|
|
|
property var onItemChecked
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
id: root
|
|
|
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
|
|
ScrollBar.vertical.policy: groupMembers.contentHeight > groupMembers.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
anchors.fill: parent
|
|
|
|
model: ListModel {
|
|
|
|
id: membersData
|
|
|
|
}
|
|
|
|
spacing: 0
|
|
|
|
clip: true
|
|
|
|
id: groupMembers
|
|
|
|
delegate: Contact {
|
|
|
|
isVisible: {
|
|
|
|
if (selectMode) {
|
|
|
|
return !searchString || model.name.toLowerCase().includes(searchString)
|
|
|
|
}
|
2021-08-09 11:11:04 +00:00
|
|
|
|
|
|
|
return isChecked || isUser
|
2020-12-11 20:38:10 +00:00
|
|
|
}
|
|
|
|
showCheckbox: root.selectMode
|
|
|
|
pubKey: model.pubKey
|
|
|
|
isContact: !!model.isContact
|
|
|
|
isUser: model.isUser
|
|
|
|
name: !model.name.endsWith(".eth") && !!model.localNickname ?
|
|
|
|
model.localNickname : Utils.removeStatusEns(model.name)
|
|
|
|
address: model.address
|
|
|
|
identicon: model.thumbnailImage || model.identicon
|
|
|
|
onItemChecked: function (pubKey, itemChecked) {
|
|
|
|
root.onItemChecked(pubKey, itemChecked)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|