Page MenuHomePhorge

No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None
diff --git a/src/contents/ui/EventReadIndicator.qml b/src/contents/ui/EventReadIndicator.qml
index 60e9a89..04d1b26 100644
--- a/src/contents/ui/EventReadIndicator.qml
+++ b/src/contents/ui/EventReadIndicator.qml
@@ -1,100 +1,100 @@
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2020-2023 tusooa <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import org.kde.kirigami 2.13 as Kirigami
import '.' as Kazv
ItemDelegate {
id: readIndicator
property var shouldShow: true
property var model
property var maxItems: 4
property var avatarSize: Kirigami.Units.iconSizes.sizeForLabels || Kirigami.Units.iconSizes.small / 2
property var actualItems: Math.min(model.count, maxItems)
visible: shouldShow && readIndicator.model.count > 0
implicitHeight: layout.implicitHeight
implicitWidth: layout.implicitWidth
RowLayout {
id: layout
objectName: 'readIndicatorLayout'
anchors.fill: parent
Repeater {
model: readIndicator.actualItems
Kirigami.Avatar {
objectName: `readIndicatorAvatar${index}`
property var member: readIndicator.model.at(index)
Layout.preferredWidth: readIndicator.avatarSize
Layout.preferredHeight: readIndicator.avatarSize
source: member.avatarMxcUri ? matrixSdk.mxcUriToHttp(member.avatarMxcUri) : ''
name: member.name || member.userId
}
}
Label {
objectName: 'moreUsersIndicator'
visible: readIndicator.model.count > readIndicator.maxItems
text: l10n.get('event-read-indicator-more', { rest: readIndicator.model.count - readIndicator.maxItems })
}
}
Kirigami.OverlayDrawer {
id: readIndicatorDrawer
edge: Qt.BottomEdge
modal: true
contentItem: ColumnLayout {
Label {
text: l10n.get('event-read-indicator-list-title', { numUsers: readIndicator.model.count })
}
Repeater {
model: readIndicator.model
ItemDelegate {
Layout.fillWidth: true
implicitWidth: itemLayout.implicitWidth
implicitHeight: itemLayout.implicitHeight
property var member: readIndicator.model.at(index)
onPressed: {
activateUserPage(member, room);
readIndicatorDrawer.close();
}
RowLayout {
id: itemLayout
anchors.fill: parent
Kirigami.Avatar {
objectName: `readIndicatorAvatar${index}`
Layout.preferredWidth: readIndicator.avatarSize
Layout.preferredHeight: readIndicator.avatarSize
source: member.avatarMxcUri ? matrixSdk.mxcUriToHttp(member.avatarMxcUri) : ''
name: member.name || member.userId
}
Label {
text: member.name || member.userId
Layout.fillWidth: true
}
Label {
Layout.alignment: Qt.AlignRight
text: member.formattedTime
}
}
}
}
}
}
- onClicked: readIndicatorDrawer.open()
+ onPressed: readIndicatorDrawer.open()
}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Jan 19, 10:30 AM (49 m, 52 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
55105
Default Alt Text
(3 KB)

Event Timeline