display list of contacts in the open chat modal
This commit is contained in:
parent
1c2154f11e
commit
fe82f762bb
|
@ -3,13 +3,19 @@ import QtQuick.Controls 2.3
|
||||||
import QtQuick.Layouts 1.3
|
import QtQuick.Layouts 1.3
|
||||||
import "../../../../imports"
|
import "../../../../imports"
|
||||||
import "../../../../shared"
|
import "../../../../shared"
|
||||||
|
import "../../Profile/Sections/Contacts/"
|
||||||
import "./"
|
import "./"
|
||||||
|
|
||||||
ModalPopup {
|
ModalPopup {
|
||||||
|
|
||||||
function doJoin(){
|
function doJoin(){
|
||||||
if(chatKey.text === "") return;
|
if (chatKey.text !== "") {
|
||||||
chatsModel.joinChat(chatKey.text, Constants.chatTypeOneToOne);
|
chatsModel.joinChat(chatKey.text, Constants.chatTypeOneToOne);
|
||||||
|
} else if (contactListView.selectedContact.checked) {
|
||||||
|
chatsModel.joinChat(contactListView.selectedContact.parent.address, Constants.chatTypeOneToOne);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
popup.close();
|
popup.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +25,7 @@ ModalPopup {
|
||||||
onOpened: {
|
onOpened: {
|
||||||
chatKey.text = "";
|
chatKey.text = "";
|
||||||
chatKey.forceActiveFocus(Qt.MouseFocusReason)
|
chatKey.forceActiveFocus(Qt.MouseFocusReason)
|
||||||
|
contactListView.selectedContact.checked = false
|
||||||
}
|
}
|
||||||
|
|
||||||
Input {
|
Input {
|
||||||
|
@ -28,6 +35,12 @@ ModalPopup {
|
||||||
Keys.onReturnPressed: doJoin()
|
Keys.onReturnPressed: doJoin()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ContactList {
|
||||||
|
id: contactListView
|
||||||
|
contacts: profileModel.contactList
|
||||||
|
selectable: true
|
||||||
|
}
|
||||||
|
|
||||||
footer: Button {
|
footer: Button {
|
||||||
width: 44
|
width: 44
|
||||||
height: 44
|
height: 44
|
||||||
|
@ -47,3 +60,9 @@ ModalPopup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*##^##
|
||||||
|
Designer {
|
||||||
|
D{i:0;height:300;width:300}
|
||||||
|
}
|
||||||
|
##^##*/
|
||||||
|
|
|
@ -9,6 +9,7 @@ Rectangle {
|
||||||
property string name: "Jotaro Kujo"
|
property string name: "Jotaro Kujo"
|
||||||
property string address: "0x04d8c07dd137bd1b73a6f51df148b4f77ddaa11209d36e43d8344c0a7d6db1cad6085f27cfb75dd3ae21d86ceffebe4cf8a35b9ce8d26baa19dc264efe6d8f221b"
|
property string address: "0x04d8c07dd137bd1b73a6f51df148b4f77ddaa11209d36e43d8344c0a7d6db1cad6085f27cfb75dd3ae21d86ceffebe4cf8a35b9ce8d26baa19dc264efe6d8f221b"
|
||||||
property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
|
property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
|
||||||
|
property bool selectable: false
|
||||||
|
|
||||||
height: 64
|
height: 64
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@ -46,4 +47,11 @@ Rectangle {
|
||||||
font.pixelSize: 15
|
font.pixelSize: 15
|
||||||
color: Theme.darkGrey
|
color: Theme.darkGrey
|
||||||
}
|
}
|
||||||
|
RadioButton {
|
||||||
|
visible: selectable
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: Theme.smallPadding
|
||||||
|
anchors.right: parent.right
|
||||||
|
ButtonGroup.group: contactGroup
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,10 @@ import "../../../../../imports"
|
||||||
import "../../../../../shared"
|
import "../../../../../shared"
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
|
id: contactList
|
||||||
property var contacts: ContactsData {}
|
property var contacts: ContactsData {}
|
||||||
|
property var selectable: true
|
||||||
|
property alias selectedContact: contactGroup.checkedButton
|
||||||
|
|
||||||
anchors.topMargin: 48
|
anchors.topMargin: 48
|
||||||
anchors.top: element2.bottom
|
anchors.top: element2.bottom
|
||||||
|
@ -18,6 +21,11 @@ ListView {
|
||||||
name: model.name
|
name: model.name
|
||||||
address: model.address
|
address: model.address
|
||||||
identicon: model.identicon
|
identicon: model.identicon
|
||||||
|
selectable: contactList.selectable
|
||||||
|
}
|
||||||
|
|
||||||
|
ButtonGroup {
|
||||||
|
id: contactGroup
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*##^##
|
/*##^##
|
||||||
|
|
|
@ -25,5 +25,12 @@ Item {
|
||||||
ContactList {
|
ContactList {
|
||||||
id: contactListView
|
id: contactListView
|
||||||
contacts: profileModel.contactList
|
contacts: profileModel.contactList
|
||||||
|
selectable: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*##^##
|
||||||
|
Designer {
|
||||||
|
D{i:0;width:600}
|
||||||
|
}
|
||||||
|
##^##*/
|
||||||
|
|
Loading…
Reference in New Issue