Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85630865
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/contents/ui/EventReadIndicator.qml b/src/contents/ui/EventReadIndicator.qml
index 103286f..2cbb17a 100644
--- a/src/contents/ui/EventReadIndicator.qml
+++ b/src/contents/ui/EventReadIndicator.qml
@@ -1,106 +1,112 @@
/*
* 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 moe.kazv.mxc.kazv 0.0 as MK
import '.' as Kazv
import 'matrix-helpers.js' as Helpers
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
Kazv.AvatarAdapter {
objectName: `readIndicatorAvatar${index}`
property var member: readIndicator.model.at(index)
property var nameProvider: Kazv.UserNameProvider {
user: member
}
Layout.preferredWidth: readIndicator.avatarSize
Layout.preferredHeight: readIndicator.avatarSize
source: member.avatarMxcUri ? matrixSdk.mxcUriToHttp(member.avatarMxcUri) : ''
name: nameProvider.name
}
}
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
+ Component.onCompleted: {
+ if (MK.KazvUtil.kfQtMajorVersion === 6) {
+ readIndicatorDrawer.parent = Overlay.overlay;
+ }
+ }
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)
property var nameProvider: Kazv.UserNameProvider {
user: member
}
onPressed: {
activateUserPage(member, room);
readIndicatorDrawer.close();
}
RowLayout {
id: itemLayout
anchors.fill: parent
Kazv.AvatarAdapter {
objectName: `readIndicatorAvatar${index}`
Layout.preferredWidth: readIndicator.avatarSize
Layout.preferredHeight: readIndicator.avatarSize
source: member.avatarMxcUri ? matrixSdk.mxcUriToHttp(member.avatarMxcUri) : ''
name: nameProvider.name
}
Label {
text: nameProvider.name
Layout.fillWidth: true
}
Label {
Layout.alignment: Qt.AlignRight
text: member.formattedTime
}
}
}
}
}
}
onPressed: readIndicatorDrawer.open()
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Aug 9, 11:35 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1724821
Default Alt Text
(3 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment