Dynamic load reply qml stuff if needed
This commit is contained in:
@@ -89,47 +89,9 @@ RowLayout {
|
|||||||
color: author.color
|
color: author.color
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
}
|
}
|
||||||
|
Loader {
|
||||||
RowLayout {
|
source: 'qrc:imports/NeoChat/Component/Timeline/ReplyComponent.qml'
|
||||||
Layout.fillWidth: true
|
active: replyVisible
|
||||||
|
|
||||||
visible: replyVisible
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
Layout.preferredWidth: Kirigami.Units.smallSpacing
|
|
||||||
Layout.fillHeight: true
|
|
||||||
|
|
||||||
color: Kirigami.Theme.highlightColor
|
|
||||||
}
|
|
||||||
|
|
||||||
Kirigami.Avatar {
|
|
||||||
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
|
|
||||||
Layout.preferredHeight: Kirigami.Units.iconSizes.smallMedium
|
|
||||||
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 {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
QQC2.Label {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
text: replyVisible ? reply.author.displayName : ""
|
|
||||||
color: replyVisible ? reply.author.color: null
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
|
|
||||||
QQC2.Label {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: replyVisible ? reply.display : ""
|
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
|
||||||
textFormat: Text.RichText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
53
imports/NeoChat/Component/Timeline/ReplyComponent.qml
Normal file
53
imports/NeoChat/Component/Timeline/ReplyComponent.qml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
* SPDX-FileCopyrightText: 2019 Black Hat <bhat@encom.eu.org>
|
||||||
|
* SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
|
||||||
|
*
|
||||||
|
* SPDX-LicenseIdentifier: GPL-3.0-or-later
|
||||||
|
*/
|
||||||
|
import QtQuick 2.12
|
||||||
|
import QtQuick.Controls 2.12 as QQC2
|
||||||
|
import QtQuick.Layouts 1.12
|
||||||
|
import org.kde.kirigami 2.13 as Kirigami
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
visible: replyVisible
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.smallSpacing
|
||||||
|
Layout.fillHeight: true
|
||||||
|
|
||||||
|
color: Kirigami.Theme.highlightColor
|
||||||
|
}
|
||||||
|
|
||||||
|
Kirigami.Avatar {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
|
||||||
|
Layout.preferredHeight: Kirigami.Units.iconSizes.smallMedium
|
||||||
|
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 {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
QQC2.Label {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
text: replyVisible ? reply.author.displayName : ""
|
||||||
|
color: replyVisible ? reply.author.color: null
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
}
|
||||||
|
|
||||||
|
QQC2.Label {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: replyVisible ? reply.display : ""
|
||||||
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
textFormat: Text.RichText
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
3
res.qrc
3
res.qrc
@@ -19,8 +19,9 @@
|
|||||||
<file>imports/NeoChat/Component/FullScreenImage.qml</file>
|
<file>imports/NeoChat/Component/FullScreenImage.qml</file>
|
||||||
<file>imports/NeoChat/Component/Emoji/EmojiPicker.qml</file>
|
<file>imports/NeoChat/Component/Emoji/EmojiPicker.qml</file>
|
||||||
<file>imports/NeoChat/Component/Emoji/qmldir</file>
|
<file>imports/NeoChat/Component/Emoji/qmldir</file>
|
||||||
<file>imports/NeoChat/Component/Timeline/MessageDelegate.qml</file>
|
|
||||||
<file>imports/NeoChat/Component/Timeline/qmldir</file>
|
<file>imports/NeoChat/Component/Timeline/qmldir</file>
|
||||||
|
<file>imports/NeoChat/Component/Timeline/MessageDelegate.qml</file>
|
||||||
|
<file>imports/NeoChat/Component/Timeline/ReplyComponent.qml</file>
|
||||||
<file>imports/NeoChat/Component/Timeline/StateDelegate.qml</file>
|
<file>imports/NeoChat/Component/Timeline/StateDelegate.qml</file>
|
||||||
<file>imports/NeoChat/Component/Timeline/TextDelegate.qml</file>
|
<file>imports/NeoChat/Component/Timeline/TextDelegate.qml</file>
|
||||||
<file>imports/NeoChat/Component/Timeline/TimelineContainer.qml</file>
|
<file>imports/NeoChat/Component/Timeline/TimelineContainer.qml</file>
|
||||||
|
|||||||
Reference in New Issue
Block a user