2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-05-28 12:56:43 +00:00
|
|
|
import "../../../../shared"
|
2020-11-13 15:28:27 +00:00
|
|
|
import "../../../../shared/status"
|
2020-05-28 12:56:43 +00:00
|
|
|
import "./"
|
|
|
|
|
2020-05-29 16:27:50 +00:00
|
|
|
ModalPopup {
|
2021-07-20 15:22:09 +00:00
|
|
|
id: popup
|
|
|
|
//% "New chat"
|
|
|
|
title: qsTrId("new-chat")
|
|
|
|
|
|
|
|
signal profileClicked()
|
2021-02-08 12:21:23 +00:00
|
|
|
function doJoin(pk, ensName) {
|
2021-06-17 22:09:00 +00:00
|
|
|
chatsModel.channelView.joinPrivateChat(pk, Utils.isChatKey(pk) ? "" : ensName);
|
2020-06-15 16:24:21 +00:00
|
|
|
popup.close();
|
|
|
|
}
|
|
|
|
|
2020-05-29 18:38:11 +00:00
|
|
|
onOpened: {
|
2021-03-31 19:14:40 +00:00
|
|
|
contactFieldAndList.chatKey.text = ""
|
|
|
|
contactFieldAndList.pubKey = ""
|
|
|
|
contactFieldAndList.ensUsername = ""
|
|
|
|
contactFieldAndList.chatKey.forceActiveFocus(Qt.MouseFocusReason)
|
|
|
|
contactFieldAndList.existingContacts.visible = profileModel.contacts.list.hasAddedContacts()
|
|
|
|
contactFieldAndList.noContactsRect.visible = !contactFieldAndList.existingContacts.visible
|
|
|
|
}
|
|
|
|
|
|
|
|
ContactsListAndSearch {
|
|
|
|
id: contactFieldAndList
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.bottom: parent.bottom
|
2021-07-15 11:12:46 +00:00
|
|
|
width: parent.width
|
2021-07-13 09:57:11 +00:00
|
|
|
addContactEnabled: false
|
2021-03-31 19:14:40 +00:00
|
|
|
onUserClicked: function (isContact, pubKey, ensName) {
|
2021-06-17 22:09:00 +00:00
|
|
|
chatsModel.channelView.joinPrivateChat(pubKey, Utils.isChatKey(pubKey) ? "" : ensName);
|
2021-03-31 19:14:40 +00:00
|
|
|
popup.close();
|
2021-02-08 12:21:23 +00:00
|
|
|
}
|
2020-11-16 20:56:10 +00:00
|
|
|
}
|
2021-07-20 15:22:09 +00:00
|
|
|
|
|
|
|
Control {
|
|
|
|
width: 124
|
|
|
|
height: 36
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 24
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
background: Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
radius: 34
|
2021-09-20 08:35:24 +00:00
|
|
|
color: Style.current.blue
|
2021-07-20 15:22:09 +00:00
|
|
|
}
|
|
|
|
contentItem: Item {
|
|
|
|
anchors.fill: parent
|
2021-07-30 14:00:25 +00:00
|
|
|
RoundedImage {
|
2021-07-20 15:22:09 +00:00
|
|
|
id: dollarEmoji
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 2
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2021-07-30 14:00:25 +00:00
|
|
|
source: appMain.getProfileImage(profileModel.profile.pubKey)
|
2021-07-20 15:22:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
anchors.left: dollarEmoji.right
|
|
|
|
anchors.leftMargin: 6
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2021-07-30 16:02:22 +00:00
|
|
|
//% "My Profile"
|
|
|
|
text: qsTrId("my-profile")
|
2021-07-20 15:22:09 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
color: Style.current.white
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: "PointingHandCursor"
|
|
|
|
onClicked: {
|
|
|
|
popup.profileClicked();
|
|
|
|
Config.currentMenuTab = 0;
|
|
|
|
popup.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-05-28 12:56:43 +00:00
|
|
|
}
|
2020-06-16 18:04:56 +00:00
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;height:300;width:300}
|
|
|
|
}
|
|
|
|
##^##*/
|