2022-07-25 15:07:19 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
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
|
|
|
|
import shared.status 1.0
|
|
|
|
import shared.stores 1.0
|
|
|
|
// TODO move Contact into shared to get rid of that import
|
|
|
|
import AppLayouts.Chat.controls 1.0
|
|
|
|
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property var contactsStore
|
|
|
|
|
|
|
|
property var pubKeys: ([])
|
|
|
|
|
|
|
|
readonly property alias count: contactGridView.count
|
|
|
|
|
|
|
|
StatusGridView {
|
|
|
|
id: contactGridView
|
|
|
|
anchors.fill: parent
|
|
|
|
rightMargin: 0
|
|
|
|
cellWidth: parent.width / 2
|
2022-08-23 14:57:37 +00:00
|
|
|
cellHeight: 2 * Style.current.xlPadding + Style.current.halfPadding
|
2022-07-25 15:07:19 +00:00
|
|
|
|
|
|
|
model: SortFilterProxyModel {
|
|
|
|
sourceModel: root.contactsStore.myContactsModel
|
|
|
|
filters: [
|
|
|
|
ExpressionFilter { expression: root.pubKeys.indexOf(model.pubKey) > -1 }
|
|
|
|
]
|
|
|
|
}
|
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)
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.name: model.icon
|
2022-09-28 21:07:18 +00:00
|
|
|
asset.isImage: asset.name !== ""
|
|
|
|
asset.isLetterIdenticon: asset.name === ""
|
|
|
|
asset.imgIsIdenticon: false
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.width: 40
|
|
|
|
asset.height: 40
|
2022-08-23 14:57:37 +00:00
|
|
|
color: "transparent"
|
2022-09-06 15:06:33 +00:00
|
|
|
asset.color: Utils.colorForColorId(model.colorId)
|
2023-04-19 16:48:57 +00:00
|
|
|
ringSettings.ringSpecModel: model.colorHash
|
2022-08-23 14:57:37 +00:00
|
|
|
statusListItemIcon.badge.border.color: Theme.palette.baseColor4
|
|
|
|
statusListItemIcon.badge.implicitHeight: 14 // 10 px + 2 px * 2 borders
|
|
|
|
statusListItemIcon.badge.implicitWidth: 14 // 10 px + 2 px * 2 borders
|
2022-10-25 09:06:18 +00:00
|
|
|
|
|
|
|
sensor.enabled: false
|
2022-07-25 15:07:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-08-11 11:55:08 +00:00
|
|
|
|