Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85595706
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 2eec811..fb6b3c7 100644
--- a/src/contents/ui/EventReadIndicator.qml
+++ b/src/contents/ui/EventReadIndicator.qml
@@ -1,111 +1,116 @@
/*
* 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
contentItem: RowLayout {
id: layout
objectName: 'readIndicatorLayout'
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
mxcUri: 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;
- }
- }
+ parent: Overlay.overlay
contentItem: ScrollView {
id: scrollView
anchors.fill: parent
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
ColumnLayout {
width: scrollView.availableWidth
- Label {
+ Kirigami.Heading {
+ Layout.fillWidth: true
+ Layout.leftMargin: Kirigami.Units.largeSpacing
+ Layout.rightMargin: Kirigami.Units.largeSpacing
+ Layout.topMargin: Kirigami.Units.largeSpacing
+ Layout.bottomMargin: Kirigami.Units.smallSpacing
+ wrapMode: Text.Wrap
+ level: 3
text: l10n.get('event-read-indicator-list-title', { numUsers: readIndicator.model.count })
}
Repeater {
model: readIndicator.model
ItemDelegate {
Layout.fillWidth: true
+ Layout.leftMargin: Kirigami.Units.largeSpacing
+ Layout.rightMargin: Kirigami.Units.largeSpacing
property var member: readIndicator.model.at(index)
property var nameProvider: Kazv.UserNameProvider {
user: member
}
onPressed: {
activateUserPage(member, room);
readIndicatorDrawer.close();
}
contentItem: RowLayout {
id: itemLayout
Kazv.AvatarAdapter {
objectName: `readIndicatorAvatar${index}`
Layout.preferredWidth: readIndicator.avatarSize
Layout.preferredHeight: readIndicator.avatarSize
mxcUri: 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, Jul 19, 8:41 PM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1695369
Default Alt Text
(3 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment