This repository has been archived on 2021-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
ui/qml/widgets/ContactList.qml

73 lines
1.3 KiB
QML
Raw Normal View History

2018-10-23 18:52:13 +00:00
import QtGraphicalEffects 1.0
import QtQuick 2.7
import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
ColumnLayout {
id: root
MyProfile{
id: myprof
}
Flickable { // CONTACT LIST
id: sv
//Layout.alignment: Qt.AlignLeft | Qt.AlignTop
clip: true
Layout.minimumHeight: 100
//Layout.maximumHeight: parent.height - 30
Layout.fillHeight: true
Layout.minimumWidth: parent.width
Layout.maximumWidth: parent.width
contentWidth: colContacts.width
contentHeight: colContacts.height
boundsBehavior: Flickable.StopAtBounds
2018-10-28 02:49:14 +00:00
maximumFlickVelocity: 400
2018-10-23 18:52:13 +00:00
2018-10-28 02:49:14 +00:00
ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AlwaysOn
}
ColumnLayout {
2018-10-23 18:52:13 +00:00
id: colContacts
width: root.width
spacing: 0
Connections { // ADD/REMOVE CONTACT ENTRIES
target: gcd
2018-10-28 02:49:14 +00:00
onAddContact: function(name, onion, server, image, badge, trusted) {
2018-10-23 18:52:13 +00:00
contactsModel.append({
"n": name,
"o": onion,
2018-10-28 02:49:14 +00:00
"s": server,
2018-10-23 18:52:13 +00:00
"i": image,
"b": badge,
"t": trusted
})
}
}
ListModel { // CONTACT OBJECTS ARE STORED HERE ...
id: contactsModel
}
Repeater {
model: contactsModel // ... AND DISPLAYED HERE
delegate: Contact{
nick: n
onion: o
2018-10-28 02:49:14 +00:00
server: s
image: i
2018-10-23 18:52:13 +00:00
badge: b
isTrusted: t
}
}
}
}
}