fix(Communities): ensure community profile popup is rendered correctly

Fixes: #3398
This commit is contained in:
Pascal Precht 2021-09-07 15:37:00 +02:00 committed by RichΛrd
parent 6e9f14c6ac
commit 52b302aa55
2 changed files with 16 additions and 16 deletions

View File

@ -13,15 +13,15 @@ StatusModal {
id: popup id: popup
onClosed: { onClosed: {
while (contentComponent.depth > 1) { while (contentItem.depth > 1) {
contentComponent.pop() contentItem.pop()
} }
} }
header.title: contentComponent.currentItem.headerTitle header.title: contentItem.currentItem.headerTitle
header.subTitle: contentComponent.currentItem.headerSubtitle || "" header.subTitle: contentItem.currentItem.headerSubtitle || ""
header.image.source: contentComponent.currentItem.headerImageSource || "" header.image.source: contentItem.currentItem.headerImageSource || ""
header.icon.isLetterIdenticon: contentComponent.currentItem.headerTitle == popup.community.name && !contentComponent.currentItem.headerImageSource header.icon.isLetterIdenticon: contentItem.currentItem.headerTitle == popup.community.name && !contentItem.currentItem.headerImageSource
header.icon.background.color: popup.community.communityColor header.icon.background.color: popup.community.communityColor
contentItem: StackView { contentItem: StackView {
@ -29,7 +29,7 @@ StatusModal {
initialItem: profileOverview initialItem: profileOverview
anchors.centerIn: parent anchors.centerIn: parent
width: popup.width width: popup.width
height: currentItem.implicitHeight || currentItem.height implicitHeight: currentItem.implicitHeight || currentItem.height
pushEnter: Transition { enabled: false } pushEnter: Transition { enabled: false }
pushExit: Transition { enabled: false } pushExit: Transition { enabled: false }
@ -57,7 +57,7 @@ StatusModal {
headerImageSource: popup.community.thumbnailImage headerImageSource: popup.community.thumbnailImage
community: popup.community community: popup.community
onMembersListButtonClicked: popup.contentComponent.push(membersList) onMembersListButtonClicked: popup.contentItem.push(membersList)
onNotificationsButtonClicked: { onNotificationsButtonClicked: {
chatsModel.communities.setCommunityMuted(popup.community.id, checked) chatsModel.communities.setCommunityMuted(popup.community.id, checked)
} }
@ -90,7 +90,7 @@ StatusModal {
headerTitle: qsTrId("members-label") headerTitle: qsTrId("members-label")
headerSubtitle: popup.community.nbMembers.toString() headerSubtitle: popup.community.nbMembers.toString()
community: popup.community community: popup.community
onInviteButtonClicked: popup.contentComponent.push(inviteFriendsView) onInviteButtonClicked: popup.contentItem.push(inviteFriendsView)
} }
} }
@ -119,10 +119,10 @@ StatusModal {
icon.height: 16 icon.height: 16
icon.width: 20 icon.width: 20
rotation: 180 rotation: 180
visible: contentComponent.depth > 1 visible: contentItem.depth > 1
height: !visible ? 0 : implicitHeight height: !visible ? 0 : implicitHeight
onClicked: { onClicked: {
contentComponent.pop() contentItem.pop()
} }
} }
] ]
@ -131,12 +131,12 @@ StatusModal {
StatusButton { StatusButton {
//% "Invite" //% "Invite"
text: qsTrId("community-invite-title") text: qsTrId("community-invite-title")
visible: popup.contentComponent.depth > 2 visible: popup.contentItem.depth > 2
height: !visible ? 0 : implicitHeight height: !visible ? 0 : implicitHeight
enabled: popup.contentComponent.currentItem.contactListSearch !== undefined && popup.contentComponent.currentItem.contactListSearch.pubKeys.length > 0 enabled: popup.contentItem.currentItem.contactListSearch !== undefined && popup.contentItem.currentItem.contactListSearch.pubKeys.length > 0
onClicked: { onClicked: {
popup.contentComponent.currentItem.sendInvites(popup.contentComponent.currentItem.contactListSearch.pubKeys) popup.contentItem.currentItem.sendInvites(popup.contentItem.currentItem.contactListSearch.pubKeys)
popup.contentComponent.pop() popup.contentItem.pop()
} }
} }
] ]

View File

@ -14,7 +14,7 @@ import "../components"
Item { Item {
id: root id: root
height: childrenRect.height implicitHeight: childrenRect.height
implicitWidth: 480 implicitWidth: 480
property string headerTitle: "" property string headerTitle: ""