fix(InviteFriendsToCommunityPopup): fixed popup height issues

Closes #5362
This commit is contained in:
Alexandra Betouni 2022-04-06 20:13:49 +03:00 committed by Iuri Matias
parent 3a4c6bfd71
commit d0701e900c
4 changed files with 8 additions and 9 deletions

View File

@ -15,7 +15,8 @@ import "."
Item { Item {
id: root id: root
height: childrenRect.height + 24 height: (chatKey.height + message.height + existingContacts.height
+ searchResults.height + noContactsRect.height + 24)
property var rootStore property var rootStore
property var contactsStore property var contactsStore
@ -67,6 +68,7 @@ Item {
//% "Enter ENS username or chat key" //% "Enter ENS username or chat key"
placeholderText: qsTrId("enter-contact-code") placeholderText: qsTrId("enter-contact-code")
visible: showSearch visible: showSearch
height: visible ? implicitHeight : 0
Keys.onReleased: { Keys.onReleased: {
successMessage = ""; successMessage = "";
searchResults.pubKey = ""; searchResults.pubKey = "";
@ -165,6 +167,7 @@ Item {
id: message id: message
text: root.validationError || successMessage text: root.validationError || successMessage
visible: root.validationError !== "" || successMessage !== "" visible: root.validationError !== "" || successMessage !== ""
height: visible ? contentHeight : 0
font.pixelSize: 13 font.pixelSize: 13
color: !!root.validationError ? Style.current.danger : Style.current.success color: !!root.validationError ? Style.current.danger : Style.current.success
anchors.top: chatKey.bottom anchors.top: chatKey.bottom
@ -177,7 +180,6 @@ Item {
contactsStore: root.contactsStore contactsStore: root.contactsStore
community: root.community community: root.community
visible: showContactList visible: showContactList
hideCommunityMembers: root.hideCommunityMembers hideCommunityMembers: root.hideCommunityMembers
anchors.topMargin: this.height > 0 ? Style.current.halfPadding : 0 anchors.topMargin: this.height > 0 ? Style.current.halfPadding : 0
@ -235,10 +237,7 @@ Item {
NoFriendsRectangle { NoFriendsRectangle {
id: noContactsRect id: noContactsRect
visible: showContactList visible: showContactList
anchors.top: chatKey.bottom anchors.centerIn: parent
anchors.topMargin: Style.current.xlPadding * 3
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
rootStore: root.rootStore rootStore: root.rootStore
} }
} }

View File

@ -12,6 +12,7 @@ Item {
id: root id: root
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: visible ? Math.min(contactListView.contentHeight, (expanded ? 320 : 192)) : 0
property var contactsStore property var contactsStore
property var community property var community
@ -28,7 +29,6 @@ Item {
return parts.some(p => p.startsWith(filter)) return parts.some(p => p.startsWith(filter))
} }
height: Math.min(contactListView.contentHeight, (expanded ? 320 : 192))
ScrollView { ScrollView {
anchors.fill: parent anchors.fill: parent

View File

@ -11,13 +11,13 @@ import "../popups"
Item { Item {
id: noContactsRect id: noContactsRect
width: 260 width: 260
height: visible ? 120 : 0
//% "You dont have any contacts yet. Invite your friends to start chatting." //% "You dont have any contacts yet. Invite your friends to start chatting."
property string text: qsTrId("you-don-t-have-any-contacts-yet--invite-your-friends-to-start-chatting-") property string text: qsTrId("you-don-t-have-any-contacts-yet--invite-your-friends-to-start-chatting-")
property alias textColor: noContacts.color property alias textColor: noContacts.color
property var rootStore property var rootStore
StatusBaseText { StatusBaseText {
id: noContacts id: noContacts
text: noContactsRect.text text: noContactsRect.text

View File

@ -16,8 +16,8 @@ import StatusQ.Components 0.1
Item { Item {
id: root id: root
height: 64
width: parent.width width: parent.width
height: hasExistingContacts ? 64 : 0
property bool hasExistingContacts: false property bool hasExistingContacts: false
property bool showProfileNotFoundMessage: false property bool showProfileNotFoundMessage: false