fix(Profile): ensure profile popup has window
When the profile popup is opened inside the contacts list, it doesn't have a surrounding window context (`Popup` types should usually be used within `ApplicationWindow` or `Window` components as per https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html). This is problematic when popup are nested, like it's the case with the nickname popup that will be instantiated by the profile popup. With no window context, such nested popup can't be opened by the application. This commit ensures the profile popup is created with a proper context, fixing the issue that the nickname popup won't open when visting via contacts list. Fixes #2216
This commit is contained in:
parent
438517a610
commit
57ac94c4ac
|
@ -15,6 +15,11 @@ ListView {
|
||||||
property string lowerCaseSearchString: searchString.toLowerCase()
|
property string lowerCaseSearchString: searchString.toLowerCase()
|
||||||
property string contactToRemove: ""
|
property string contactToRemove: ""
|
||||||
|
|
||||||
|
property Component profilePopupComponent: ProfilePopup {
|
||||||
|
id: profilePopup
|
||||||
|
onClosed: destroy()
|
||||||
|
}
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
model: contacts
|
model: contacts
|
||||||
|
@ -26,7 +31,10 @@ ListView {
|
||||||
identicon: model.thumbnailImage || model.identicon
|
identicon: model.thumbnailImage || model.identicon
|
||||||
isContact: model.isContact
|
isContact: model.isContact
|
||||||
isBlocked: model.isBlocked
|
isBlocked: model.isBlocked
|
||||||
profileClick: profilePopup.openPopup.bind(profilePopup)
|
profileClick: function (showFooter, userName, fromAuthor, identicon, textParam, nickName) {
|
||||||
|
var popup = profilePopupComponent.createObject(contactList);
|
||||||
|
popup.openPopup(showFooter, userName, fromAuthor, identicon, textParam, nickName);
|
||||||
|
}
|
||||||
visible: searchString === "" ||
|
visible: searchString === "" ||
|
||||||
model.name.toLowerCase().includes(lowerCaseSearchString) ||
|
model.name.toLowerCase().includes(lowerCaseSearchString) ||
|
||||||
model.address.toLowerCase().includes(lowerCaseSearchString)
|
model.address.toLowerCase().includes(lowerCaseSearchString)
|
||||||
|
@ -41,10 +49,6 @@ ListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfilePopup {
|
|
||||||
id: profilePopup
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Make BlockContactConfirmationDialog a dynamic component on a future refactor
|
// TODO: Make BlockContactConfirmationDialog a dynamic component on a future refactor
|
||||||
BlockContactConfirmationDialog {
|
BlockContactConfirmationDialog {
|
||||||
id: blockContactConfirmationDialog
|
id: blockContactConfirmationDialog
|
||||||
|
|
Loading…
Reference in New Issue