Clicking on an reply move the timeline view to the reply

This commit is contained in:
Carl Schwan
2020-11-22 17:54:34 +01:00
parent 7ec6f83bcb
commit 4dedb87efa
3 changed files with 45 additions and 34 deletions

View File

@@ -9,48 +9,48 @@ import QtQuick.Controls 2.12 as QQC2
import QtQuick.Layouts 1.12
import org.kde.kirigami 2.13 as Kirigami
RowLayout {
Layout.fillWidth: true
QQC2.AbstractButton {
visible: replyVisible
Component.onCompleted: parent.Layout.fillWidth = true
Rectangle {
Layout.preferredWidth: Kirigami.Units.smallSpacing
Layout.fillHeight: true
color: Kirigami.Theme.highlightColor
}
Kirigami.Avatar {
Layout.preferredWidth: Kirigami.Units.gridUnit
Layout.preferredHeight: Kirigami.Units.gridUnit
Layout.alignment: Qt.AlignTop
source: replyVisible && reply.author.avatarMediaId ? "image://mxc/" + reply.author.avatarMediaId : ""
name: replyVisible ? reply.author.displayName : "H"
color: replyVisible ? reply.author.color : Kirigami.Theme.highlightColor
}
ColumnLayout {
id: replyLayout
contentItem: RowLayout {
Layout.fillWidth: true
QQC2.Label {
Layout.fillWidth: true
text: replyVisible ? reply.author.displayName : ""
color: replyVisible ? reply.author.color: null
elide: Text.ElideRight
Rectangle {
Layout.preferredWidth: Kirigami.Units.smallSpacing
Layout.fillHeight: true
color: Kirigami.Theme.highlightColor
}
QQC2.Label {
Kirigami.Avatar {
Layout.preferredWidth: Kirigami.Units.gridUnit
Layout.preferredHeight: Kirigami.Units.gridUnit
Layout.alignment: Qt.AlignTop
source: replyVisible && reply.author.avatarMediaId ? "image://mxc/" + reply.author.avatarMediaId : ""
name: replyVisible ? reply.author.displayName : "H"
color: replyVisible ? reply.author.color : Kirigami.Theme.highlightColor
}
ColumnLayout {
id: replyLayout
Layout.fillWidth: true
text: replyVisible ? reply.display : ""
textFormat: Text.RichText
elide: Text.ElideRight
wrapMode: Text.WordWrap
QQC2.Label {
Layout.fillWidth: true
text: replyVisible ? reply.author.displayName : ""
color: replyVisible ? reply.author.color: null
elide: Text.ElideRight
}
QQC2.Label {
Layout.fillWidth: true
text: replyVisible ? reply.display : ""
textFormat: Text.RichText
elide: Text.ElideRight
wrapMode: Text.WordWrap
}
}
}
}