summaryrefslogtreecommitdiff
path: root/kodereviewer/qml/ReviewList.qml
diff options
context:
space:
mode:
Diffstat (limited to 'kodereviewer/qml/ReviewList.qml')
-rw-r--r--kodereviewer/qml/ReviewList.qml84
1 files changed, 84 insertions, 0 deletions
diff --git a/kodereviewer/qml/ReviewList.qml b/kodereviewer/qml/ReviewList.qml
new file mode 100644
index 0000000..e8821af
--- /dev/null
+++ b/kodereviewer/qml/ReviewList.qml
@@ -0,0 +1,84 @@
+pragma ComponentBehavior: Bound
+import QtQuick
+import QtCore
+import QtQuick.Controls as QQC2
+import QtQuick.Layouts
+
+import org.kde.kirigami as Kirigami
+import org.kde.kirigamiaddons.formcard as FormCard
+import org.kde.kirigamiaddons.components as KirigamiComponents
+
+
+Kirigami.CardsListView {
+ id: root
+
+ Kirigami.PlaceholderMessage {
+ visible: root.count == 0
+ anchors.centerIn: parent
+ text: "No reviews!"
+ }
+
+ delegate: Kirigami.AbstractCard {
+ id: delegate
+
+ required property int id
+ required property string diff
+ required property var reviews
+
+ clip: true
+
+ header: Editor {
+ text: delegate.diff
+ file: "bla.txt"
+ }
+
+ contentItem: Item {
+ implicitHeight: commentsLayout.implicitHeight
+ implicitWidth: commentsLayout.implicitWidth
+ ColumnLayout {
+ id: commentsLayout
+ anchors.fill: parent
+
+ Repeater {
+ model: delegate.reviews
+ ColumnLayout {
+ required property var modelData
+
+ Kirigami.Separator {
+ Layout.fillWidth: true
+ }
+ RowLayout {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+
+ KirigamiComponents.Avatar {
+ name: modelData.user.username
+ source: modelData.user.avatarUrl
+ Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
+ Layout.preferredHeight: Kirigami.Units.iconSizes.smallMedium
+ Layout.fillWidth: false
+ Layout.alignment: Qt.AlignTop
+ }
+ QQC2.Label {
+ text: `@${modelData.user.username}`
+ Layout.fillWidth: false
+ Layout.alignment: Qt.AlignTop
+ }
+ }
+ MarkdownLabel {
+ Layout.fillWidth: true
+ text: modelData.body
+ }
+
+ }
+ }
+
+ MarkdownTextArea {
+ id: addComment
+ Layout.fillWidth: true
+ }
+ }
+ }
+ }
+}
+