chore(settings/messaging): `id: contactListRoot` -> `id: root`

This commit is contained in:
Patryk Osmaczko 2022-08-16 13:11:12 +02:00 committed by osmaczko
parent e9a307c383
commit c46cd1922b
1 changed files with 22 additions and 22 deletions

View File

@ -16,7 +16,7 @@ import "."
import SortFilterProxyModel 0.2 import SortFilterProxyModel 0.2
Item { Item {
id: contactListRoot id: root
property var contactsStore property var contactsStore
property var contactsModel property var contactsModel
@ -41,8 +41,8 @@ Item {
id: title id: title
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.padding anchors.leftMargin: Style.current.padding
visible: contactsList.count > 0 && contactListRoot.title !== "" visible: contactsList.count > 0 && root.title !== ""
text: contactListRoot.title text: root.title
font.weight: Font.Medium font.weight: Font.Medium
font.pixelSize: 15 font.pixelSize: 15
color: Style.current.secondaryText color: Style.current.secondaryText
@ -55,11 +55,11 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
interactive: false interactive: false
ScrollBar.vertical.policy: contactListRoot.scrollbarOn ? ScrollBar.AlwaysOn : ScrollBar.AsNeeded ScrollBar.vertical.policy: root.scrollbarOn ? ScrollBar.AlwaysOn : ScrollBar.AsNeeded
model: SortFilterProxyModel { model: SortFilterProxyModel {
id: filteredModel id: filteredModel
sourceModel: contactListRoot.contactsModel sourceModel: root.contactsModel
function panelUsagePredicate(isVerified) { function panelUsagePredicate(isVerified) {
if (panelUsage === Constants.contactsPanelUsage.verifiedMutualContacts) return isVerified if (panelUsage === Constants.contactsPanelUsage.verifiedMutualContacts) return isVerified
@ -68,9 +68,9 @@ Item {
} }
function searchPredicate(name, pubkey) { function searchPredicate(name, pubkey) {
if (contactListRoot.searchString === "") return true if (root.searchString === "") return true
let lowerCaseSearchString = contactListRoot.searchString.toLowerCase() let lowerCaseSearchString = root.searchString.toLowerCase()
let compressedPubkey = Utils.getCompressedPk(pubkey) let compressedPubkey = Utils.getCompressedPk(pubkey)
return name.toLowerCase().includes(lowerCaseSearchString) || return name.toLowerCase().includes(lowerCaseSearchString) ||
@ -82,7 +82,7 @@ Item {
ExpressionFilter { expression: filteredModel.panelUsagePredicate(model.isVerified) }, ExpressionFilter { expression: filteredModel.panelUsagePredicate(model.isVerified) },
ExpressionFilter { ExpressionFilter {
expression: { expression: {
contactListRoot.searchString // ensure expression is reevaluated when searchString changes root.searchString // ensure expression is reevaluated when searchString changes
filteredModel.searchPredicate(model.displayName, model.pubKey) filteredModel.searchPredicate(model.displayName, model.pubKey)
} }
} }
@ -92,7 +92,7 @@ Item {
delegate: ContactPanel { delegate: ContactPanel {
id: panelDelegate id: panelDelegate
width: ListView.view.width width: ListView.view.width
contactsStore: contactListRoot.contactsStore contactsStore: root.contactsStore
name: model.displayName name: model.displayName
publicKey: model.pubKey publicKey: model.pubKey
iconSource: model.icon iconSource: model.icon
@ -104,34 +104,34 @@ Item {
showSendMessageButton: isContact && !isBlocked showSendMessageButton: isContact && !isBlocked
onOpenContactContextMenu: function (publicKey, name, icon) { onOpenContactContextMenu: function (publicKey, name, icon) {
contactListRoot.openContactContextMenu(publicKey, name, icon) root.openContactContextMenu(publicKey, name, icon)
} }
showRejectContactRequestButton: { showRejectContactRequestButton: {
if (contactListRoot.panelUsage === Constants.contactsPanelUsage.receivedContactRequest && !model.verificationRequestStatus) { if (root.panelUsage === Constants.contactsPanelUsage.receivedContactRequest && !model.verificationRequestStatus) {
return true return true
} }
return false return false
} }
showAcceptContactRequestButton: { showAcceptContactRequestButton: {
if (contactListRoot.panelUsage === Constants.contactsPanelUsage.receivedContactRequest && !model.verificationRequestStatus) { if (root.panelUsage === Constants.contactsPanelUsage.receivedContactRequest && !model.verificationRequestStatus) {
return true return true
} }
return false return false
} }
showRemoveRejectionButton: { showRemoveRejectionButton: {
if (contactListRoot.panelUsage === Constants.contactsPanelUsage.rejectedReceivedContactRequest) { if (root.panelUsage === Constants.contactsPanelUsage.rejectedReceivedContactRequest) {
return true return true
} }
return false return false
} }
contactText: { contactText: {
if (contactListRoot.panelUsage === Constants.contactsPanelUsage.sentContactRequest) { if (root.panelUsage === Constants.contactsPanelUsage.sentContactRequest) {
return qsTr("Contact Request Sent") return qsTr("Contact Request Sent")
} }
else if (contactListRoot.panelUsage === Constants.contactsPanelUsage.rejectedSentContactRequest) { else if (root.panelUsage === Constants.contactsPanelUsage.rejectedSentContactRequest) {
return qsTr("Contact Request Rejected") return qsTr("Contact Request Rejected")
} }
@ -141,13 +141,13 @@ Item {
return false return false
} }
onClicked: contactListRoot.contactClicked(model.pubKey) onClicked: root.contactClicked(model.pubKey)
onSendMessageActionTriggered: contactListRoot.sendMessageActionTriggered(publicKey) onSendMessageActionTriggered: root.sendMessageActionTriggered(publicKey)
onContactRequestAccepted: contactListRoot.contactRequestAccepted(publicKey) onContactRequestAccepted: root.contactRequestAccepted(publicKey)
onContactRequestRejected: contactListRoot.contactRequestRejected(publicKey) onContactRequestRejected: root.contactRequestRejected(publicKey)
onRejectionRemoved: contactListRoot.rejectionRemoved(publicKey) onRejectionRemoved: root.rejectionRemoved(publicKey)
onTextClicked: contactListRoot.textClicked(publicKey) onTextClicked: root.textClicked(publicKey)
onShowVerificationRequest: contactListRoot.showVerificationRequest(publicKey) onShowVerificationRequest: root.showVerificationRequest(publicKey)
} }
} }
} }