2021-07-06 22:41:26 +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
|
|
|
|
import "../../../../shared"
|
|
|
|
import "../../../../shared/status"
|
|
|
|
import "../../../../imports"
|
|
|
|
import "../components"
|
|
|
|
import "../ChatColumn/MessageComponents"
|
|
|
|
import "../ChatColumn/"
|
|
|
|
import "../ContactsColumn"
|
|
|
|
|
2021-07-22 14:53:19 +00:00
|
|
|
Item {
|
2021-07-06 22:41:26 +00:00
|
|
|
id: root
|
2021-07-22 14:53:19 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
property var userList
|
|
|
|
property var currentTime
|
2021-09-01 17:38:39 +00:00
|
|
|
property var messageContextMenu
|
2021-07-22 14:53:19 +00:00
|
|
|
property QtObject community: chatsModel.communities.activeCommunity
|
|
|
|
|
|
|
|
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-08-18 09:33:49 +00:00
|
|
|
font.bold: true
|
2021-07-30 16:02:22 +00:00
|
|
|
//% "Members"
|
|
|
|
text: qsTrId("members-label")
|
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
|
|
|
|
ScrollBar.vertical: ScrollBar { }
|
2021-07-22 14:53:19 +00:00
|
|
|
anchors {
|
|
|
|
top: titleText.bottom
|
|
|
|
topMargin: Style.current.padding
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
2021-08-26 12:04:47 +00:00
|
|
|
rightMargin: Style.current.halfPadding
|
2021-07-22 14:53:19 +00:00
|
|
|
bottom: parent.bottom
|
|
|
|
bottomMargin: Style.current.bigPadding
|
|
|
|
}
|
2021-07-06 22:41:26 +00:00
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
model: userListDelegate
|
2021-08-18 09:33:49 +00:00
|
|
|
section.property: "online"
|
2021-08-26 12:04:47 +00:00
|
|
|
section.delegate: (root.width > 58) ? sectionDelegateComponent : null
|
|
|
|
Component {
|
|
|
|
id: sectionDelegateComponent
|
|
|
|
Item {
|
|
|
|
width: parent.width
|
|
|
|
height: 24
|
|
|
|
StyledText {
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.leftMargin: Style.current.padding
|
2021-08-27 12:48:53 +00:00
|
|
|
verticalAlignment: Text.AlignVCenter
|
2021-08-26 12:04:47 +00:00
|
|
|
font.pixelSize: Style.current.additionalTextSize
|
|
|
|
color: Style.current.darkGrey
|
|
|
|
text: section === 'true' ? qsTr("Online") : qsTr("Offline")
|
|
|
|
}
|
2021-08-18 09:33:49 +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) {
|
2021-08-18 09:33:49 +00:00
|
|
|
return left.sortKey.localeCompare(right.sortKey) < 0
|
2021-07-06 22:41:26 +00:00
|
|
|
}
|
|
|
|
]
|
2021-08-20 11:12:49 +00:00
|
|
|
model: community.members
|
2021-07-06 22:41:26 +00:00
|
|
|
delegate: User {
|
|
|
|
publicKey: model.pubKey
|
2021-08-20 11:12:49 +00:00
|
|
|
name: model.userName
|
2021-07-06 22:41:26 +00:00
|
|
|
identicon: model.identicon
|
2021-08-18 09:33:49 +00:00
|
|
|
lastSeen: model.lastSeen
|
|
|
|
statusType: model.statusType
|
2021-07-22 14:53:19 +00:00
|
|
|
currentTime: root.currentTime
|
2021-08-27 12:48:53 +00:00
|
|
|
isOnline: model.online
|
2021-07-06 22:41:26 +00:00
|
|
|
}
|
|
|
|
}
|
2021-07-22 14:53:19 +00:00
|
|
|
}
|