2021-07-06 17:58:19 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import Qt.labs.platform 1.1
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Window 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtQml.Models 2.13
|
|
|
|
import QtGraphicalEffects 1.13
|
|
|
|
import QtQuick.Dialogs 1.3
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.status 1.0
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
import "../controls"
|
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2021-07-06 17:58:19 +00:00
|
|
|
|
2021-07-22 14:53:19 +00:00
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
anchors.fill: parent
|
|
|
|
property var userList
|
|
|
|
property var currentTime
|
2021-10-01 15:58:36 +00:00
|
|
|
property bool isOnline
|
|
|
|
property var contactsList
|
|
|
|
property string profilePubKey
|
2021-09-01 17:38:39 +00:00
|
|
|
property var messageContextMenu
|
2021-07-06 17:58:19 +00:00
|
|
|
|
2021-07-22 14:53:19 +00:00
|
|
|
StyledText {
|
|
|
|
id: titleText
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Style.current.padding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
2021-08-26 12:04:47 +00:00
|
|
|
opacity: (root.width > 58) ? 1.0 : 0.0
|
2021-07-22 14:53:19 +00:00
|
|
|
visible: (opacity > 0.1)
|
|
|
|
font.pixelSize: Style.current.primaryTextFontSize
|
2021-07-30 16:02:22 +00:00
|
|
|
//% "Members"
|
2021-09-14 10:09:40 +00:00
|
|
|
text: qsTr("Last seen")
|
2021-07-22 14:53:19 +00:00
|
|
|
}
|
2021-07-06 22:41:26 +00:00
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: userListView
|
2021-07-27 08:51:32 +00:00
|
|
|
clip: true
|
2021-09-21 13:13:17 +00:00
|
|
|
ScrollBar.vertical: ScrollBar {
|
|
|
|
policy: ScrollBar.AsNeeded
|
|
|
|
}
|
2021-07-22 14:53:19 +00:00
|
|
|
anchors {
|
|
|
|
top: titleText.bottom
|
|
|
|
topMargin: Style.current.padding
|
2021-11-30 12:27:08 +00:00
|
|
|
left: parent.left
|
2021-07-22 14:53:19 +00:00
|
|
|
right: parent.right
|
|
|
|
bottom: parent.bottom
|
|
|
|
bottomMargin: Style.current.bigPadding
|
|
|
|
}
|
2021-07-06 22:41:26 +00:00
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
model: userListDelegate
|
|
|
|
}
|
2021-07-22 14:53:19 +00:00
|
|
|
|
2021-07-06 22:41:26 +00:00
|
|
|
DelegateModelGeneralized {
|
|
|
|
id: userListDelegate
|
|
|
|
lessThan: [
|
2021-07-22 14:53:19 +00:00
|
|
|
function (left, right) {
|
|
|
|
return (left.lastSeen > right.lastSeen);
|
2021-07-06 17:58:19 +00:00
|
|
|
}
|
2021-07-06 22:41:26 +00:00
|
|
|
]
|
2021-07-22 14:53:19 +00:00
|
|
|
model: root.userList
|
2021-10-01 15:58:36 +00:00
|
|
|
delegate: UserDelegate {
|
2021-07-06 22:41:26 +00:00
|
|
|
name: model.userName
|
2021-11-30 12:27:08 +00:00
|
|
|
publicKey: model.publicKey
|
|
|
|
profilePubKey: root.profilePubKey
|
2021-07-06 22:41:26 +00:00
|
|
|
identicon: model.identicon
|
2021-11-30 12:27:08 +00:00
|
|
|
contactsList: root.contactsList
|
2021-07-27 14:25:51 +00:00
|
|
|
lastSeen: model.lastSeen / 1000
|
2021-07-22 14:53:19 +00:00
|
|
|
currentTime: root.currentTime
|
2021-10-01 15:58:36 +00:00
|
|
|
isOnline: root.isOnline
|
2021-07-06 17:58:19 +00:00
|
|
|
}
|
2021-07-06 22:41:26 +00:00
|
|
|
}
|
2021-07-22 14:53:19 +00:00
|
|
|
}
|