Alexandra Betouni 4ee21ada05 feat(desktop) Added image function in Style
Introduced Style.svg() Style.png() Style.emoji() and
Style.icon() in Style.qml. Those should be used to
set the source in Images instead of using relative
paths. Usage:
Image {
   source: Style.svg("check)
   ....

Also moved all Singletons inside a new "utils"
folder and made it a QML module, to use
import utils 1.0 instead of relative paths

Closes #3678
2021-09-28 15:28:00 -04:00

74 lines
1.9 KiB
QML

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 utils 1.0
import "../components"
import "./samples/"
import "./MessageComponents"
import "../ContactsColumn"
Item {
id: root
anchors.fill: parent
property var userList
property var currentTime
property var messageContextMenu
StyledText {
id: titleText
anchors.top: parent.top
anchors.topMargin: Style.current.padding
anchors.left: parent.left
anchors.leftMargin: Style.current.padding
opacity: (root.width > 58) ? 1.0 : 0.0
visible: (opacity > 0.1)
font.pixelSize: Style.current.primaryTextFontSize
//% "Members"
text: qsTr("Last seen")
}
ListView {
id: userListView
clip: true
ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AsNeeded
}
anchors {
left: parent.left
top: titleText.bottom
topMargin: Style.current.padding
right: parent.right
rightMargin: Style.current.halfPadding
bottom: parent.bottom
bottomMargin: Style.current.bigPadding
}
boundsBehavior: Flickable.StopAtBounds
model: userListDelegate
}
DelegateModelGeneralized {
id: userListDelegate
lessThan: [
function (left, right) {
return (left.lastSeen > right.lastSeen);
}
]
model: root.userList
delegate: User {
publicKey: model.publicKey
name: model.userName
identicon: model.identicon
lastSeen: model.lastSeen / 1000
currentTime: root.currentTime
}
}
}