status-desktop/ui/imports/shared/controls/delegates/ContactListItemDelegate.qml
Lukáš Tinkl c5598d9ff9 chore(StatusMemberListItem): refactor to use ItemDelegate
- simpler, standard property based API
- much lighter than deriving from the heavy StatusListItem
- should reduce RAM usage significantly, esp. with large communities

Iterates #11059
2024-09-12 15:04:22 +02:00

30 lines
874 B
QML

import QtQuick 2.15
import QtQuick.Controls 2.15
import StatusQ.Components 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
/**
attached model property should be compatible with nim's contact model
*/
StatusMemberListItem {
id: root
readonly property string _pubKey: model.pubKey // expose uncompressed pubkey
pubKey: model.isEnsVerified ? "" : Utils.getCompressedPk(model.pubKey)
nickName: model.localNickname
userName: ProfileUtils.displayName("", model.ensName, model.displayName, model.alias)
isVerified: model.isVerified
isUntrustworthy: model.isUntrustworthy
isContact: model.isContact
icon.name: model.icon
icon.color: Utils.colorForColorId(model.colorId)
status: model.onlineStatus
ringSettings.ringSpecModel: model.colorHash
color: (hovered || highlighted) ? Theme.palette.baseColor2 : "transparent"
}