status-desktop/ui/app/AppLayouts/Chat/popups/PrivateChatPopup.qml

97 lines
2.8 KiB
QML
Raw Normal View History

2020-06-17 19:18:31 +00:00
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import shared.controls 1.0
import shared 1.0
import shared.panels 1.0
import shared.popups 1.0
import shared.status 1.0
2020-05-28 12:56:43 +00:00
import "./"
// TODO: replace with StatusModal
2020-05-29 16:27:50 +00:00
ModalPopup {
id: popup
//% "New chat"
title: qsTrId("new-chat")
property var store
signal profileClicked()
function doJoin(pk, ensName) {
popup.store.chatsModelInst.channelView.joinPrivateChat(pk, Utils.isChatKey(pk) ? "" : ensName);
popup.close();
}
2020-05-29 18:38:11 +00:00
onOpened: {
contactFieldAndList.chatKey.text = ""
contactFieldAndList.pubKey = ""
contactFieldAndList.ensUsername = ""
contactFieldAndList.chatKey.forceActiveFocus(Qt.MouseFocusReason)
contactFieldAndList.existingContacts.visible = popup.store.profileModelInst.contacts.list.hasAddedContacts()
contactFieldAndList.noContactsRect.visible = !contactFieldAndList.existingContacts.visible
}
ContactsListAndSearch {
id: contactFieldAndList
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width
addContactEnabled: false
onUserClicked: function (isContact, pubKey, ensName) {
popup.store.chatsModelInst.channelView.joinPrivateChat(pubKey, Utils.isChatKey(pubKey) ? "" : ensName);
popup.close();
}
2020-11-16 20:56:10 +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
color: Style.current.blue
}
contentItem: Item {
anchors.fill: parent
RoundedImage {
id: dollarEmoji
width: 32
height: 32
anchors.left: parent.left
anchors.leftMargin: 2
anchors.verticalCenter: parent.verticalCenter
source: appMain.getProfileImage(popup.store.profileModelInst.profile.pubKey)
}
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")
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
}
/*##^##
Designer {
D{i:0;height:300;width:300}
}
##^##*/