2023-02-22 01:48:49 +03:00
|
|
|
// SPDX-FileCopyrightText: Nheko Contributors
|
2021-07-24 01:11:33 +03:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-09-25 06:27:57 +03:00
|
|
|
import ".."
|
2021-07-24 01:11:33 +03:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import im.nheko 1.0
|
|
|
|
|
|
|
|
ApplicationWindow {
|
|
|
|
id: readReceiptsRoot
|
|
|
|
|
2021-07-29 04:31:37 +03:00
|
|
|
property ReadReceiptsProxy readReceipts
|
2021-07-30 04:29:09 +03:00
|
|
|
property Room room
|
2021-07-24 01:11:33 +03:00
|
|
|
|
|
|
|
height: 380
|
|
|
|
width: 340
|
|
|
|
minimumHeight: 380
|
|
|
|
minimumWidth: headerTitle.width + 2 * Nheko.paddingMedium
|
2023-06-02 02:29:05 +03:00
|
|
|
color: palette.window
|
2021-08-19 17:55:54 +03:00
|
|
|
flags: Qt.Dialog | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
|
2021-07-24 01:11:33 +03:00
|
|
|
|
2021-07-25 01:38:22 +03:00
|
|
|
Shortcut {
|
|
|
|
sequence: StandardKey.Cancel
|
|
|
|
onActivated: readReceiptsRoot.close()
|
|
|
|
}
|
|
|
|
|
2021-07-24 01:11:33 +03:00
|
|
|
ColumnLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: Nheko.paddingMedium
|
|
|
|
spacing: Nheko.paddingMedium
|
|
|
|
|
|
|
|
Label {
|
|
|
|
id: headerTitle
|
|
|
|
|
2023-06-02 02:29:05 +03:00
|
|
|
color: palette.text
|
2021-07-24 01:11:33 +03:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
text: qsTr("Read receipts")
|
|
|
|
font.pointSize: fontMetrics.font.pointSize * 1.5
|
|
|
|
}
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
padding: Nheko.paddingMedium
|
|
|
|
ScrollBar.horizontal.visible: false
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.minimumHeight: 200
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: readReceiptsList
|
|
|
|
|
|
|
|
clip: true
|
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
model: readReceipts
|
|
|
|
|
2021-11-06 02:35:13 +03:00
|
|
|
delegate: ItemDelegate {
|
2021-11-13 22:05:27 +03:00
|
|
|
id: del
|
|
|
|
|
2021-11-06 02:35:13 +03:00
|
|
|
onClicked: room.openUserProfile(model.mxid)
|
|
|
|
padding: Nheko.paddingMedium
|
2021-11-13 22:05:27 +03:00
|
|
|
width: ListView.view.width
|
2021-11-13 22:38:22 +03:00
|
|
|
height: receiptLayout.implicitHeight + Nheko.paddingSmall * 2
|
2021-11-06 02:35:13 +03:00
|
|
|
hoverEnabled: true
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
ToolTip.text: model.mxid
|
2021-11-13 22:05:27 +03:00
|
|
|
background: Rectangle {
|
2023-06-02 02:29:05 +03:00
|
|
|
color: del.hovered ? palette.dark : readReceiptsRoot.color
|
2021-11-13 22:05:27 +03:00
|
|
|
}
|
2021-07-24 01:11:33 +03:00
|
|
|
|
2021-11-06 02:35:13 +03:00
|
|
|
RowLayout {
|
|
|
|
id: receiptLayout
|
2021-07-24 01:11:33 +03:00
|
|
|
|
2021-11-06 02:35:13 +03:00
|
|
|
spacing: Nheko.paddingMedium
|
2021-11-16 03:04:33 +03:00
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: Nheko.paddingSmall
|
2021-07-24 01:11:33 +03:00
|
|
|
|
2021-11-06 02:35:13 +03:00
|
|
|
Avatar {
|
2023-02-26 06:25:43 +03:00
|
|
|
id: avatar
|
|
|
|
|
2021-11-06 02:35:13 +03:00
|
|
|
width: Nheko.avatarSize
|
|
|
|
height: Nheko.avatarSize
|
|
|
|
userid: model.mxid
|
|
|
|
url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
|
|
|
|
displayName: model.displayName
|
2021-11-09 05:26:35 +03:00
|
|
|
enabled: false
|
2021-11-06 02:35:13 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
spacing: Nheko.paddingSmall
|
2023-02-26 06:25:43 +03:00
|
|
|
Layout.fillWidth: true
|
2021-07-24 01:11:33 +03:00
|
|
|
|
2023-02-26 06:25:43 +03:00
|
|
|
ElidedLabel {
|
2023-06-03 01:30:44 +03:00
|
|
|
fullText: model.displayName
|
2023-06-02 02:29:05 +03:00
|
|
|
color: TimelineManager.userColor(model ? model.mxid : "", palette.window)
|
2021-11-06 02:35:13 +03:00
|
|
|
font.pointSize: fontMetrics.font.pointSize
|
2023-02-26 06:25:43 +03:00
|
|
|
elideWidth: del.width - Nheko.paddingMedium - avatar.width
|
|
|
|
Layout.fillWidth: true
|
2021-07-24 01:11:33 +03:00
|
|
|
}
|
|
|
|
|
2023-02-26 06:25:43 +03:00
|
|
|
ElidedLabel {
|
2023-06-03 01:30:44 +03:00
|
|
|
fullText: model.timestamp
|
2023-06-02 02:29:05 +03:00
|
|
|
color: palette.buttonText
|
2021-11-06 02:35:13 +03:00
|
|
|
font.pointSize: fontMetrics.font.pointSize * 0.9
|
2023-02-26 06:25:43 +03:00
|
|
|
elideWidth: del.width - Nheko.paddingMedium - avatar.width
|
|
|
|
Layout.fillWidth: true
|
2021-07-24 01:11:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-11-06 02:35:13 +03:00
|
|
|
}
|
2021-07-24 01:11:33 +03:00
|
|
|
|
2023-06-19 02:38:40 +03:00
|
|
|
NhekoCursorShape {
|
2021-11-06 02:35:13 +03:00
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
2021-07-24 01:11:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-07-24 19:51:45 +03:00
|
|
|
footer: DialogButtonBox {
|
|
|
|
standardButtons: DialogButtonBox.Ok
|
|
|
|
onAccepted: readReceiptsRoot.close()
|
|
|
|
}
|
|
|
|
|
2021-07-24 01:11:33 +03:00
|
|
|
}
|