refactor(ContactsContainer): make use of NoFriendsRectangle
This commit is contained in:
parent
1b009d634d
commit
105c4cba4a
|
@ -6,16 +6,17 @@ import "../../../../shared/status"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: noContactsRect
|
id: noContactsRect
|
||||||
width: 260
|
width: 260
|
||||||
|
property string text: qsTr("You don’t have any contacts yet. Invite your friends to start chatting.")
|
||||||
StyledText {
|
StyledText {
|
||||||
id: noContacts
|
id: noContacts
|
||||||
//% "You don’t have any contacts yet. Invite your friends to start chatting."
|
text: noContactsRect.text
|
||||||
text: qsTrId("you-don-t-have-any-contacts-yet--invite-your-friends-to-start-chatting-")
|
|
||||||
color: Style.current.darkGrey
|
color: Style.current.darkGrey
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: Style.current.padding
|
anchors.topMargin: Style.current.padding
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
font.pixelSize: 15
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
}
|
}
|
||||||
StatusButton {
|
StatusButton {
|
||||||
|
|
|
@ -149,35 +149,13 @@ ModalPopup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
|
NoFriendsRectangle {
|
||||||
id: noContactsRect
|
id: noContactsRect
|
||||||
width: 260
|
visible: profileModel.contacts.addedContacts.rowCount() === 0
|
||||||
anchors.centerIn: parent
|
text: qsTr("You don’t have any contacts yet. Invite your friends to start chatting.")
|
||||||
StyledText {
|
width: parent.width
|
||||||
id: noContacts
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
//% "You don’t have any contacts yet. Invite your friends to start chatting."
|
|
||||||
text: qsTrId("you-don-t-have-any-contacts-yet--invite-your-friends-to-start-chatting-")
|
|
||||||
color: Style.current.darkGrey
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: Style.current.padding
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
StatusButton {
|
|
||||||
//% "Invite friends"
|
|
||||||
text: qsTrId("invite-friends")
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
anchors.top: noContacts.bottom
|
|
||||||
anchors.topMargin: Style.current.xlPadding
|
|
||||||
onClicked: {
|
|
||||||
inviteFriendsPopup.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
InviteFriendsPopup {
|
|
||||||
id: inviteFriendsPopup
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,37 +232,12 @@ Item {
|
||||||
searchString: searchBox.text
|
searchString: searchBox.text
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
NoFriendsRectangle {
|
||||||
id: element
|
id: element
|
||||||
visible: profileModel.contacts.addedContacts.rowCount() === 0
|
visible: profileModel.contacts.addedContacts.rowCount() === 0
|
||||||
anchors.top: addNewContact.bottom
|
text: qsTr("You don’t have any contacts yet")
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.bottom: parent.bottom
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: noFriendsText
|
|
||||||
//% "You don’t have any contacts yet"
|
|
||||||
text: qsTrId("you-don-t-have-any-contacts-yet")
|
|
||||||
anchors.verticalCenterOffset: -Style.current.bigPadding
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
font.pixelSize: 15
|
|
||||||
color: Style.current.darkGrey
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusButton {
|
|
||||||
anchors.horizontalCenter: noFriendsText.horizontalCenter
|
|
||||||
anchors.top: noFriendsText.bottom
|
|
||||||
anchors.topMargin: Style.current.bigPadding
|
|
||||||
//% "Invite friends"
|
|
||||||
text: qsTrId("invite-friends")
|
|
||||||
onClicked: function () {
|
|
||||||
inviteFriendsPopup.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
InviteFriendsPopup {
|
|
||||||
id: inviteFriendsPopup
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue