2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2022-07-25 15:07:19 +00:00
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ 0.1
|
2022-07-25 15:07:19 +00:00
|
|
|
import StatusQ.Core 0.1
|
2022-08-23 14:57:37 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-07-25 15:07:19 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2024-05-22 08:13:39 +00:00
|
|
|
import AppLayouts.Profile.stores 1.0 as ProfileStores
|
2022-07-25 15:07:19 +00:00
|
|
|
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
property ProfileStores.ContactsStore contactsStore
|
2022-07-25 15:07:19 +00:00
|
|
|
|
|
|
|
property var pubKeys: ([])
|
|
|
|
|
|
|
|
readonly property alias count: contactGridView.count
|
|
|
|
|
|
|
|
StatusGridView {
|
|
|
|
id: contactGridView
|
|
|
|
anchors.fill: parent
|
|
|
|
rightMargin: 0
|
|
|
|
cellWidth: parent.width / 2
|
2024-10-15 19:26:12 +00:00
|
|
|
cellHeight: 2 * Theme.xlPadding + Theme.halfPadding
|
2022-07-25 15:07:19 +00:00
|
|
|
|
|
|
|
model: SortFilterProxyModel {
|
|
|
|
sourceModel: root.contactsStore.myContactsModel
|
|
|
|
filters: [
|
2024-10-15 19:26:12 +00:00
|
|
|
FastExpressionFilter {
|
|
|
|
expression: root.pubKeys.indexOf(model.pubKey) > -1
|
|
|
|
expectedRoles: ["pubKey"]
|
|
|
|
}
|
2022-07-25 15:07:19 +00:00
|
|
|
]
|
|
|
|
}
|
2022-08-23 14:57:37 +00:00
|
|
|
|
|
|
|
delegate: StatusMemberListItem {
|
2022-07-25 15:07:19 +00:00
|
|
|
width: contactGridView.cellWidth
|
2023-04-19 16:48:57 +00:00
|
|
|
pubKey: model.isEnsVerified ? "" : Utils.getCompressedPk(model.pubKey)
|
2022-07-25 15:07:19 +00:00
|
|
|
isContact: model.isContact
|
2022-08-23 14:57:37 +00:00
|
|
|
status: model.onlineStatus
|
2022-12-05 09:56:44 +00:00
|
|
|
nickName: model.localNickname
|
|
|
|
userName: ProfileUtils.displayName("", model.ensName, model.displayName, model.alias)
|
2024-09-06 13:11:47 +00:00
|
|
|
icon.name: model.icon
|
|
|
|
icon.width: 40
|
|
|
|
icon.height: 40
|
2022-08-23 14:57:37 +00:00
|
|
|
color: "transparent"
|
2024-09-06 13:11:47 +00:00
|
|
|
icon.color: Utils.colorForColorId(model.colorId)
|
2023-04-19 16:48:57 +00:00
|
|
|
ringSettings.ringSpecModel: model.colorHash
|
2024-09-06 13:11:47 +00:00
|
|
|
badge.border.color: Theme.palette.baseColor4
|
|
|
|
badge.implicitHeight: 14 // 10 px + 2 px * 2 borders
|
|
|
|
badge.implicitWidth: 14 // 10 px + 2 px * 2 borders
|
2022-10-25 09:06:18 +00:00
|
|
|
|
2024-09-06 13:11:47 +00:00
|
|
|
hoverEnabled: false
|
2022-07-25 15:07:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|