Clicking on an reply move the timeline view to the reply
This commit is contained in:
@@ -30,6 +30,7 @@ RowLayout {
|
|||||||
|
|
||||||
signal saveFileAs()
|
signal saveFileAs()
|
||||||
signal openExternally()
|
signal openExternally()
|
||||||
|
signal replyClicked(string eventID)
|
||||||
|
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
@@ -90,9 +91,14 @@ RowLayout {
|
|||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
}
|
}
|
||||||
Loader {
|
Loader {
|
||||||
|
id: replyLoader
|
||||||
source: 'qrc:imports/NeoChat/Component/Timeline/ReplyComponent.qml'
|
source: 'qrc:imports/NeoChat/Component/Timeline/ReplyComponent.qml'
|
||||||
active: replyVisible
|
active: replyVisible
|
||||||
}
|
}
|
||||||
|
Connections {
|
||||||
|
target: replyLoader.item
|
||||||
|
onClicked: replyClicked(reply.eventId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,48 +9,48 @@ import QtQuick.Controls 2.12 as QQC2
|
|||||||
import QtQuick.Layouts 1.12
|
import QtQuick.Layouts 1.12
|
||||||
import org.kde.kirigami 2.13 as Kirigami
|
import org.kde.kirigami 2.13 as Kirigami
|
||||||
|
|
||||||
RowLayout {
|
QQC2.AbstractButton {
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
visible: replyVisible
|
visible: replyVisible
|
||||||
|
|
||||||
Component.onCompleted: parent.Layout.fillWidth = true
|
Component.onCompleted: parent.Layout.fillWidth = true
|
||||||
|
|
||||||
Rectangle {
|
contentItem: RowLayout {
|
||||||
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
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
QQC2.Label {
|
Rectangle {
|
||||||
Layout.fillWidth: true
|
Layout.preferredWidth: Kirigami.Units.smallSpacing
|
||||||
text: replyVisible ? reply.author.displayName : ""
|
Layout.fillHeight: true
|
||||||
color: replyVisible ? reply.author.color: null
|
|
||||||
elide: Text.ElideRight
|
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
|
Layout.fillWidth: true
|
||||||
text: replyVisible ? reply.display : ""
|
|
||||||
textFormat: Text.RichText
|
QQC2.Label {
|
||||||
elide: Text.ElideRight
|
Layout.fillWidth: true
|
||||||
wrapMode: Text.WordWrap
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -203,6 +203,7 @@ Kirigami.ScrollablePage {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: openMessageContext(author, display, eventId, toolTip);
|
onClicked: openMessageContext(author, display, eventId, toolTip);
|
||||||
}
|
}
|
||||||
|
onReplyClicked: goToEvent(eventID)
|
||||||
innerObject: [
|
innerObject: [
|
||||||
TextDelegate {
|
TextDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -225,6 +226,7 @@ Kirigami.ScrollablePage {
|
|||||||
|
|
||||||
innerObject: MessageDelegate {
|
innerObject: MessageDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
onReplyClicked: goToEvent(eventID)
|
||||||
|
|
||||||
innerObject: TextDelegate {
|
innerObject: TextDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -240,6 +242,7 @@ Kirigami.ScrollablePage {
|
|||||||
|
|
||||||
innerObject: MessageDelegate {
|
innerObject: MessageDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
onReplyClicked: goToEvent(eventID)
|
||||||
|
|
||||||
innerObject: [
|
innerObject: [
|
||||||
ImageDelegate {
|
ImageDelegate {
|
||||||
@@ -264,6 +267,7 @@ Kirigami.ScrollablePage {
|
|||||||
|
|
||||||
innerObject: MessageDelegate {
|
innerObject: MessageDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
onReplyClicked: goToEvent(eventID)
|
||||||
|
|
||||||
innerObject: AudioDelegate {
|
innerObject: AudioDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -279,6 +283,7 @@ Kirigami.ScrollablePage {
|
|||||||
|
|
||||||
innerObject: MessageDelegate {
|
innerObject: MessageDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
onReplyClicked: goToEvent(eventID)
|
||||||
|
|
||||||
innerObject: AudioDelegate {
|
innerObject: AudioDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|||||||
Reference in New Issue
Block a user