Cherrypick Other user read markers 23.04
Add the ability to see other user's read markers.

Implements network/neochat#133
(cherry picked from commit 23303c0483)
This commit is contained in:
37
src/qml/Component/Timeline/AvatarFlow.qml
Normal file
37
src/qml/Component/Timeline/AvatarFlow.qml
Normal file
@@ -0,0 +1,37 @@
|
||||
// SPDX-FileCopyrightText: 2022 James Graham <james.h.graham@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15 as QQC2
|
||||
|
||||
import org.kde.kirigami 2.15 as Kirigami
|
||||
|
||||
Flow {
|
||||
id: root
|
||||
|
||||
property var avatarSize: Kirigami.Units.iconSizes.small
|
||||
property alias model: avatarFlowRepeater.model
|
||||
property string toolTipText
|
||||
|
||||
spacing: -avatarSize / 2
|
||||
Repeater {
|
||||
id: avatarFlowRepeater
|
||||
delegate: Kirigami.Avatar {
|
||||
implicitWidth: avatarSize
|
||||
implicitHeight: avatarSize
|
||||
|
||||
name: modelData.displayName
|
||||
source: modelData.avatarMediaId ? ("image://mxc/" + modelData.avatarMediaId) : ""
|
||||
color: modelData.color
|
||||
}
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: toolTipText
|
||||
QQC2.ToolTip.visible: hoverHandler.hovered
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
|
||||
HoverHandler {
|
||||
id: hoverHandler
|
||||
margin: Kirigami.Units.smallSpacing
|
||||
}
|
||||
}
|
||||
@@ -134,5 +134,12 @@ QQC2.Control {
|
||||
folded = !folded
|
||||
foldedChanged()
|
||||
}
|
||||
AvatarFlow {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.rightMargin: Kirigami.Units.largeSpacing
|
||||
visible: showReadMarkers
|
||||
model: readMarkers
|
||||
toolTipText: readMarkersString
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,6 +338,13 @@ ColumnLayout {
|
||||
|
||||
visible: eventType !== MessageEventModel.State && eventType !== MessageEventModel.Notice && reaction != undefined && reaction.length > 0
|
||||
}
|
||||
AvatarFlow {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.rightMargin: Kirigami.Units.largeSpacing
|
||||
visible: showReadMarkers
|
||||
model: readMarkers
|
||||
toolTipText: readMarkersString
|
||||
}
|
||||
|
||||
function isVisibleInTimeline() {
|
||||
let yoff = Math.round(y - ListView.view.contentY);
|
||||
|
||||
Reference in New Issue
Block a user