fix(InviteFriendsToCommunityPopup): proper spacing when searching

Closes: #7707
This commit is contained in:
Michał Cieślak 2022-12-02 00:04:28 +01:00 committed by Michał
parent 55668f160c
commit 4d5ef972bf
1 changed files with 36 additions and 23 deletions

View File

@ -13,6 +13,8 @@ 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
@ -46,28 +48,16 @@ Item {
leftMargin: 0
spacing: Style.current.padding
model: root.contactsStore.myContactsModel
delegate: StatusMemberListItem {
width: contactListView.availableWidth
pubKey: Utils.getCompressedPk(model.pubKey)
isContact: model.isContact
status: model.onlineStatus
height: visible ? implicitHeight : 0
color: sensor.containsMouse ? Style.current.backgroundHover : Style.current.transparent
userName: model.displayName
asset.name: model.icon
asset.isImage: (asset.name !== "")
asset.isLetterIdenticon: (asset.name === "")
asset.width: 40
asset.height: 40
asset.color: Utils.colorForColorId(model.colorId)
ringSettings.ringSpecModel: Utils.getColorHashAsJson(model.pubKey, model.ensName)
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
model: SortFilterProxyModel {
sourceModel: root.contactsStore.myContactsModel
filters: [
ExpressionFilter {
expression: {
root.filterText
root.hideCommunityMembers
root.communityId
visible: {
if (contactCheckbox.checked)
if (root.pubKeys.indexOf(model.pubKey) > -1)
return true
if (!model.isContact || model.isBlocked)
@ -87,6 +77,29 @@ Item {
return !root.hideCommunityMembers ||
!root.rootStore.communityHasMember(root.communityId, model.pubKey)
}
}
]
}
delegate: StatusMemberListItem {
width: contactListView.availableWidth
pubKey: Utils.getCompressedPk(model.pubKey)
isContact: model.isContact
status: model.onlineStatus
height: visible ? implicitHeight : 0
color: sensor.containsMouse ? Style.current.backgroundHover : Style.current.transparent
userName: model.displayName
asset.name: model.icon
asset.isImage: (asset.name !== "")
asset.isLetterIdenticon: (asset.name === "")
asset.width: 40
asset.height: 40
asset.color: Utils.colorForColorId(model.colorId)
ringSettings.ringSpecModel: Utils.getColorHashAsJson(model.pubKey, model.ensName)
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
onClicked: {
root.contactClicked(model);