diff --git a/ui/app/AppLayouts/Chat/components/PrivateChatPopup.qml b/ui/app/AppLayouts/Chat/components/PrivateChatPopup.qml index dca7fb2c83..03ad2f0663 100644 --- a/ui/app/AppLayouts/Chat/components/PrivateChatPopup.qml +++ b/ui/app/AppLayouts/Chat/components/PrivateChatPopup.qml @@ -3,13 +3,19 @@ import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 import "../../../../imports" import "../../../../shared" +import "../../Profile/Sections/Contacts/" import "./" ModalPopup { function doJoin(){ - if(chatKey.text === "") return; - chatsModel.joinChat(chatKey.text, Constants.chatTypeOneToOne); + if (chatKey.text !== "") { + chatsModel.joinChat(chatKey.text, Constants.chatTypeOneToOne); + } else if (contactListView.selectedContact.checked) { + chatsModel.joinChat(contactListView.selectedContact.parent.address, Constants.chatTypeOneToOne); + } else { + return; + } popup.close(); } @@ -19,6 +25,7 @@ ModalPopup { onOpened: { chatKey.text = ""; chatKey.forceActiveFocus(Qt.MouseFocusReason) + contactListView.selectedContact.checked = false } Input { @@ -28,6 +35,12 @@ ModalPopup { Keys.onReturnPressed: doJoin() } + ContactList { + id: contactListView + contacts: profileModel.contactList + selectable: true + } + footer: Button { width: 44 height: 44 @@ -47,3 +60,9 @@ ModalPopup { } } } + +/*##^## +Designer { + D{i:0;height:300;width:300} +} +##^##*/ diff --git a/ui/app/AppLayouts/Profile/Sections/Contacts/Contact.qml b/ui/app/AppLayouts/Profile/Sections/Contacts/Contact.qml index 8901b259e1..d90ec65e18 100644 --- a/ui/app/AppLayouts/Profile/Sections/Contacts/Contact.qml +++ b/ui/app/AppLayouts/Profile/Sections/Contacts/Contact.qml @@ -9,6 +9,7 @@ Rectangle { property string name: "Jotaro Kujo" property string address: "0x04d8c07dd137bd1b73a6f51df148b4f77ddaa11209d36e43d8344c0a7d6db1cad6085f27cfb75dd3ae21d86ceffebe4cf8a35b9ce8d26baa19dc264efe6d8f221b" property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=" + property bool selectable: false height: 64 anchors.right: parent.right @@ -46,4 +47,11 @@ Rectangle { font.pixelSize: 15 color: Theme.darkGrey } + RadioButton { + visible: selectable + anchors.top: parent.top + anchors.topMargin: Theme.smallPadding + anchors.right: parent.right + ButtonGroup.group: contactGroup + } } diff --git a/ui/app/AppLayouts/Profile/Sections/Contacts/ContactList.qml b/ui/app/AppLayouts/Profile/Sections/Contacts/ContactList.qml index 470f5638a9..fd1b3178f8 100644 --- a/ui/app/AppLayouts/Profile/Sections/Contacts/ContactList.qml +++ b/ui/app/AppLayouts/Profile/Sections/Contacts/ContactList.qml @@ -7,7 +7,10 @@ import "../../../../../imports" import "../../../../../shared" ListView { + id: contactList property var contacts: ContactsData {} + property var selectable: true + property alias selectedContact: contactGroup.checkedButton anchors.topMargin: 48 anchors.top: element2.bottom @@ -18,6 +21,11 @@ ListView { name: model.name address: model.address identicon: model.identicon + selectable: contactList.selectable + } + + ButtonGroup { + id: contactGroup } } /*##^## diff --git a/ui/app/AppLayouts/Profile/Sections/ContactsContainer.qml b/ui/app/AppLayouts/Profile/Sections/ContactsContainer.qml index a877026a0b..61c06b948d 100644 --- a/ui/app/AppLayouts/Profile/Sections/ContactsContainer.qml +++ b/ui/app/AppLayouts/Profile/Sections/ContactsContainer.qml @@ -25,5 +25,12 @@ Item { ContactList { id: contactListView contacts: profileModel.contactList + selectable: false } } + +/*##^## +Designer { + D{i:0;width:600} +} +##^##*/