2020-06-17 19:18:31 +00:00
|
|
|
|
import QtQuick 2.13
|
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-05-27 21:28:25 +00:00
|
|
|
|
import "../../../../imports"
|
2020-06-19 18:06:58 +00:00
|
|
|
|
import "../../../../shared"
|
2020-07-21 21:03:22 +00:00
|
|
|
|
import "../../Chat/components"
|
2020-06-13 13:49:20 +00:00
|
|
|
|
import "./Contacts"
|
2020-05-27 21:28:25 +00:00
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
id: contactsContainer
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
2020-07-21 21:03:22 +00:00
|
|
|
|
Item {
|
2020-05-27 21:28:25 +00:00
|
|
|
|
anchors.top: parent.top
|
2020-07-21 21:03:22 +00:00
|
|
|
|
anchors.topMargin: 32
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.rightMargin: contentMargin
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.leftMargin: contentMargin
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
|
|
|
|
|
SearchBox {
|
|
|
|
|
id: searchBox
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
id: addNewContact
|
|
|
|
|
anchors.top: searchBox.bottom
|
|
|
|
|
anchors.topMargin: Style.current.bigPadding
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: addButton.height
|
|
|
|
|
|
|
|
|
|
AddButton {
|
|
|
|
|
id: addButton
|
|
|
|
|
clickable: false
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
}
|
|
|
|
|
StyledText {
|
|
|
|
|
id: usernameText
|
|
|
|
|
text: qsTr("Add new contact")
|
|
|
|
|
color: Style.current.blue
|
|
|
|
|
anchors.left: addButton.right
|
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
|
anchors.verticalCenter: addButton.verticalCenter
|
|
|
|
|
font.pixelSize: 15
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
|
onClicked: {
|
|
|
|
|
// TODO implement adding a contact
|
|
|
|
|
console.log('Add a contact')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ContactList {
|
|
|
|
|
id: contactListView
|
|
|
|
|
anchors.top: addNewContact.bottom
|
|
|
|
|
anchors.topMargin: Style.current.bigPadding
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
contacts: profileModel.contactList
|
|
|
|
|
selectable: false
|
|
|
|
|
searchString: searchBox.text
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
id: element
|
|
|
|
|
visible: profileModel.contactList.rowCount() === 0
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
|
id: noFriendsText
|
|
|
|
|
text: qsTr("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
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StyledButton {
|
|
|
|
|
anchors.horizontalCenter: noFriendsText.horizontalCenter
|
|
|
|
|
anchors.top: noFriendsText.bottom
|
|
|
|
|
anchors.topMargin: Style.current.bigPadding
|
|
|
|
|
label: qsTr("Invite firends")
|
|
|
|
|
onClicked: function () {
|
|
|
|
|
inviteFriendsPopup.open()
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-05-27 21:28:25 +00:00
|
|
|
|
|
2020-07-21 21:03:22 +00:00
|
|
|
|
InviteFriendsPopup {
|
|
|
|
|
id: inviteFriendsPopup
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-05-27 21:28:25 +00:00
|
|
|
|
}
|
2020-06-13 13:49:20 +00:00
|
|
|
|
}
|
2020-06-16 18:04:56 +00:00
|
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
|
Designer {
|
2020-07-21 21:03:22 +00:00
|
|
|
|
D{i:0;autoSize:true;formeditorColor:"#ffffff";formeditorZoom:0.6600000262260437;height:480;width:600}
|
2020-06-16 18:04:56 +00:00
|
|
|
|
}
|
|
|
|
|
##^##*/
|